<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE MultiWayIf #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE TupleSections #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-12"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-13"></span><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns   #-}</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-comment">-- | Typecheck some @Matches@</span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.Gen.Match</span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatchesFun"><span class="hs-identifier">tcMatchesFun</span></a></span><span>
</span><span id="line-20"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGRHS"><span class="hs-identifier">tcGRHS</span></a></span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGRHSsPat"><span class="hs-identifier">tcGRHSsPat</span></a></span><span>
</span><span id="line-22"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatchesCase"><span class="hs-identifier">tcMatchesCase</span></a></span><span>
</span><span id="line-23"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatchLambda"><span class="hs-identifier">tcMatchLambda</span></a></span><span>
</span><span id="line-24"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier">TcMatchCtxt</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcStmtChecker"><span class="hs-identifier">TcStmtChecker</span></a></span><span>
</span><span id="line-26"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcExprStmtChecker"><span class="hs-identifier">TcExprStmtChecker</span></a></span><span>
</span><span id="line-27"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcCmdStmtChecker"><span class="hs-identifier">TcCmdStmtChecker</span></a></span><span>
</span><span id="line-28"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier">tcStmts</span></a></span><span>
</span><span id="line-29"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier">tcStmtsAndThen</span></a></span><span>
</span><span id="line-30"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier">tcDoStmts</span></a></span><span>
</span><span id="line-31"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcBody"><span class="hs-identifier">tcBody</span></a></span><span>
</span><span id="line-32"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier">tcDoStmt</span></a></span><span>
</span><span id="line-33"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier">tcGuardStmt</span></a></span><span>
</span><span id="line-34"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span class="hs-keyword">where</span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span>   </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html"><span class="hs-identifier">GHC.Tc.Gen.Expr</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier">tcSyntaxOp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcInferRho"><span class="hs-identifier">tcInferRho</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcInferRhoNC"><span class="hs-identifier">tcInferRhoNC</span></a></span><span>
</span><span id="line-40"></span><span>                                       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcMonoExpr"><span class="hs-identifier">tcMonoExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcMonoExprNC"><span class="hs-identifier">tcMonoExprNC</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcExpr"><span class="hs-identifier">tcExpr</span></a></span><span>
</span><span id="line-41"></span><span>                                       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier">tcCheckMonoExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExprNC"><span class="hs-identifier">tcCheckMonoExprNC</span></a></span><span>
</span><span id="line-42"></span><span>                                       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier">tcCheckPolyExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckId"><span class="hs-identifier">tcCheckId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#LexicalFixity"><span class="hs-identifier">LexicalFixity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Pat.html"><span class="hs-identifier">GHC.Tc.Gen.Pat</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Bind.html"><span class="hs-identifier">GHC.Tc.Gen.Bind</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html"><span class="hs-identifier">GHC.Tc.Utils.Unify</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html"><span class="hs-identifier">GHC.Tc.Types.Origin</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.UsageEnv.html"><span class="hs-identifier">GHC.Core.UsageEnv</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier">getDynFlags</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-comment">-- Create chunkified tuple tybes for monad comprehensions</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Arrow.html#"><span class="hs-identifier">Control.Arrow</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Arrow.html#second"><span class="hs-identifier">second</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-75"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{tcMatchesFun, tcMatchesCase}
*                                                                      *
************************************************************************

@tcMatchesFun@ typechecks a @[Match]@ list which occurs in a
@FunMonoBind@.  The second argument is the name of the function, which
is used in error messages.  It checks that all the equations have the
same number of arguments before using @tcMatches@ to do the work.
-}</span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatchesFun"><span class="hs-identifier hs-type">tcMatchesFun</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-89"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>    </span><span class="hs-comment">-- Expected type of function</span><span>
</span><span id="line-91"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier hs-type">HsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>                                </span><span class="hs-comment">-- Returns type of body</span><span>
</span><span id="line-93"></span><span id="tcMatchesFun"><span class="annot"><span class="annottext">tcMatchesFun :: Located Name
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; ExpRhoType
-&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
</span><a href="GHC.Tc.Gen.Match.html#tcMatchesFun"><span class="hs-identifier hs-var hs-var">tcMatchesFun</span></a></span></span><span> </span><span id="local-6989586621681123459"><span class="annot"><span class="annottext">fn :: Located Name
</span><a href="#local-6989586621681123459"><span class="hs-identifier hs-var">fn</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123457"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681123457"><span class="hs-identifier hs-var">fun_name</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123456"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123456"><span class="hs-identifier hs-var">matches</span></a></span></span><span> </span><span id="local-6989586621681123455"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123455"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span>
</span><span id="line-94"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span>  </span><span class="hs-comment">-- Check that they all have the same no of arguments</span><span>
</span><span id="line-95"></span><span>           </span><span class="hs-comment">-- Location is in the monad, set the caller so that</span><span>
</span><span id="line-96"></span><span>           </span><span class="hs-comment">-- any inter-equation error messages get some vaguely</span><span>
</span><span id="line-97"></span><span>           </span><span class="hs-comment">-- sensible location.        Note: we have to do this odd</span><span>
</span><span id="line-98"></span><span>           </span><span class="hs-comment">-- ann-grabbing, because we don't always have annotations in</span><span>
</span><span id="line-99"></span><span>           </span><span class="hs-comment">-- hand when we call tcMatchesFun...</span><span>
</span><span id="line-100"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcMatchesFun&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681123457"><span class="hs-identifier hs-var">fun_name</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123455"><span class="hs-identifier hs-var">exp_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; MatchGroup GhcRn (LHsExpr GhcRn) -&gt; TcRn ()
forall body. Name -&gt; MatchGroup GhcRn body -&gt; TcRn ()
</span><a href="GHC.Tc.Gen.Match.html#checkArgs"><span class="hs-identifier hs-var">checkArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681123457"><span class="hs-identifier hs-var">fun_name</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123456"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SDoc
-&gt; UserTypeCtxt
-&gt; Arity
-&gt; ExpRhoType
-&gt; ([Scaled ExpRhoType]
    -&gt; ExpRhoType -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
forall a.
SDoc
-&gt; UserTypeCtxt
-&gt; Arity
-&gt; ExpRhoType
-&gt; ([Scaled ExpRhoType] -&gt; ExpRhoType -&gt; TcM a)
-&gt; TcM (HsWrapper, a)
</span><a href="GHC.Tc.Utils.Unify.html#matchExpectedFunTys"><span class="hs-identifier hs-var">matchExpectedFunTys</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681123449"><span class="hs-identifier hs-var">herald</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="#local-6989586621681123448"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681123447"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123455"><span class="hs-identifier hs-var">exp_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Scaled ExpRhoType]
  -&gt; ExpRhoType -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
 -&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; ([Scaled ExpRhoType]
    -&gt; ExpRhoType -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681123446"><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123446"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span id="local-6989586621681123445"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123445"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-104"></span><span>             </span><span class="hs-comment">-- NB: exp_type may be polymorphic, but</span><span>
</span><span id="line-105"></span><span>             </span><span class="hs-comment">--     matchExpectedFunTys can cope with that</span><span>
</span><span id="line-106"></span><span>          </span><span class="annot"><span class="annottext">Mult
-&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc))
-&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc))
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (MatchGroup GhcTc (LHsExpr GhcTc))
 -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc))
-&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-107"></span><span>          </span><span class="hs-comment">-- toplevel bindings and let bindings are, at the</span><span>
</span><span id="line-108"></span><span>          </span><span class="hs-comment">-- moment, always unrestricted. The value being bound</span><span>
</span><span id="line-109"></span><span>          </span><span class="hs-comment">-- must, accordingly, be unrestricted. Hence them</span><span>
</span><span id="line-110"></span><span>          </span><span class="hs-comment">-- being scaled by Many. When let binders come with a</span><span>
</span><span id="line-111"></span><span>          </span><span class="hs-comment">-- multiplicity, then @tcMatchesFun@ will have to take</span><span>
</span><span id="line-112"></span><span>          </span><span class="hs-comment">-- a multiplicity argument, and scale accordingly.</span><span>
</span><span id="line-113"></span><span>          </span><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc))
forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatches"><span class="hs-identifier hs-var">tcMatches</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
</span><a href="#local-6989586621681123441"><span class="hs-identifier hs-var">match_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123446"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123445"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123456"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-114"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-115"></span><span>    </span><span id="local-6989586621681123447"><span class="annot"><span class="annottext">arity :: Arity
</span><a href="#local-6989586621681123447"><span class="hs-identifier hs-var hs-var">arity</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn) -&gt; Arity
forall (id :: Pass) body. MatchGroup (GhcPass id) body -&gt; Arity
</span><a href="GHC.Hs.Expr.html#matchGroupArity"><span class="hs-identifier hs-var">matchGroupArity</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123456"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span id="local-6989586621681123449"><span class="annot"><span class="annottext">herald :: SDoc
</span><a href="#local-6989586621681123449"><span class="hs-identifier hs-var hs-var">herald</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The equation(s) for&quot;</span></span><span>
</span><span id="line-117"></span><span>             </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681123457"><span class="hs-identifier hs-var">fun_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;have&quot;</span></span><span>
</span><span id="line-118"></span><span>    </span><span id="local-6989586621681123448"><span class="annot"><span class="annottext">ctxt :: UserTypeCtxt
</span><a href="#local-6989586621681123448"><span class="hs-identifier hs-var hs-var">ctxt</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#GenSigCtxt"><span class="hs-identifier hs-var">GenSigCtxt</span></a></span><span>  </span><span class="hs-comment">-- Was: FunSigCtxt fun_name True</span><span>
</span><span id="line-119"></span><span>                         </span><span class="hs-comment">-- But that's wrong for f :: Int -&gt; forall a. blah</span><span>
</span><span id="line-120"></span><span>    </span><span id="local-6989586621681123435"><span class="annot"><span class="annottext">what :: HsMatchContext GhcRn
</span><a href="#local-6989586621681123435"><span class="hs-identifier hs-var hs-var">what</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FunRhs :: forall p.
LIdP p -&gt; LexicalFixity -&gt; SrcStrictness -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#FunRhs"><span class="hs-identifier hs-type">FunRhs</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_fun :: LIdP GhcRn
</span><a href="GHC.Hs.Expr.html#mc_fun"><span class="hs-identifier hs-var">mc_fun</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
LIdP GhcRn
</span><a href="#local-6989586621681123459"><span class="hs-identifier hs-var">fn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mc_fixity :: LexicalFixity
</span><a href="GHC.Hs.Expr.html#mc_fixity"><span class="hs-identifier hs-var">mc_fixity</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LexicalFixity
</span><a href="GHC.Types.Basic.html#Prefix"><span class="hs-identifier hs-var">Prefix</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mc_strictness :: SrcStrictness
</span><a href="GHC.Hs.Expr.html#mc_strictness"><span class="hs-identifier hs-var">mc_strictness</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcStrictness
</span><a href="#local-6989586621681123429"><span class="hs-identifier hs-var">strictness</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621681123441"><span class="annot"><span class="annottext">match_ctxt :: TcMatchCtxt HsExpr
</span><a href="#local-6989586621681123441"><span class="hs-identifier hs-var hs-var">match_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MC :: forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcRn)
    -&gt; ExpRhoType -&gt; TcM (Located (body GhcTc)))
-&gt; TcMatchCtxt body
</span><a href="GHC.Tc.Gen.Match.html#MC"><span class="hs-identifier hs-type">MC</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_what :: HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var">mc_what</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681123435"><span class="hs-identifier hs-var">what</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mc_body :: LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#mc_body"><span class="hs-identifier hs-var">mc_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcBody"><span class="hs-identifier hs-var">tcBody</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621681123429"><span class="annot"><span class="annottext">strictness :: SrcStrictness
</span><a href="#local-6989586621681123429"><span class="hs-identifier hs-var hs-var">strictness</span></a></span></span><span>
</span><span id="line-123"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123425"><span class="annot"><span class="annottext">Match GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123425"><span class="hs-identifier hs-var">match</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan [LMatch GhcRn (LHsExpr GhcRn)]
-&gt; [LMatch GhcRn (LHsExpr GhcRn)]
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan [LMatch GhcRn (LHsExpr GhcRn)]
 -&gt; [LMatch GhcRn (LHsExpr GhcRn)])
-&gt; GenLocated SrcSpan [LMatch GhcRn (LHsExpr GhcRn)]
-&gt; [LMatch GhcRn (LHsExpr GhcRn)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; GenLocated SrcSpan [LMatch GhcRn (LHsExpr GhcRn)]
forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var hs-var">mg_alts</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123456"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-124"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#FunRhs"><span class="hs-identifier hs-type">FunRhs</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_strictness :: forall p. HsMatchContext p -&gt; SrcStrictness
</span><a href="GHC.Hs.Expr.html#mc_strictness"><span class="hs-identifier hs-var">mc_strictness</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcStrictness
</span><a href="GHC.Core.DataCon.html#SrcStrict"><span class="hs-identifier hs-var">SrcStrict</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Match GhcRn (LHsExpr GhcRn) -&gt; HsMatchContext (NoGhcTc GhcRn)
forall p body. Match p body -&gt; HsMatchContext (NoGhcTc p)
</span><a href="GHC.Hs.Expr.html#m_ctxt"><span class="hs-identifier hs-var hs-var">m_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Match GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123425"><span class="hs-identifier hs-var">match</span></a></span><span>
</span><span id="line-125"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcStrictness
</span><a href="GHC.Core.DataCon.html#SrcStrict"><span class="hs-identifier hs-var">SrcStrict</span></a></span><span>
</span><span id="line-126"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-127"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcStrictness
</span><a href="GHC.Core.DataCon.html#NoSrcStrict"><span class="hs-identifier hs-var">NoSrcStrict</span></a></span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-comment">{-
@tcMatchesCase@ doesn't do the argument-count check because the
parser guarantees that each equation has exactly one argument.
-}</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span id="local-6989586621681123799"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatchesCase"><span class="hs-identifier hs-type">tcMatchesCase</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123799"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-135"></span><span>                </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-type">TcMatchCtxt</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123799"><span class="hs-identifier hs-type">body</span></a></span><span>                        </span><span class="hs-comment">-- Case context</span><span>
</span><span id="line-136"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcSigmaType"><span class="hs-identifier hs-type">TcSigmaType</span></a></span><span>                      </span><span class="hs-comment">-- Type of scrutinee</span><span>
</span><span id="line-137"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123799"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- The case alternatives</span><span>
</span><span id="line-138"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>                    </span><span class="hs-comment">-- Type of whole case expressions</span><span>
</span><span id="line-139"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123799"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-140"></span><span>                </span><span class="hs-comment">-- Translated alternatives</span><span>
</span><span id="line-141"></span><span>                </span><span class="hs-comment">-- wrapper goes from MatchGroup's ty to expected ty</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span id="tcMatchesCase"><span class="annot"><span class="annottext">tcMatchesCase :: forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; Scaled Mult
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; ExpRhoType
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatchesCase"><span class="hs-identifier hs-var hs-var">tcMatchesCase</span></a></span></span><span> </span><span id="local-6989586621681123416"><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123416"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span id="local-6989586621681123414"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123414"><span class="hs-identifier hs-var">scrut_mult</span></a></span></span><span> </span><span id="local-6989586621681123413"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123413"><span class="hs-identifier hs-var">scrut_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123412"><span class="annot"><span class="annottext">MatchGroup GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123412"><span class="hs-identifier hs-var">matches</span></a></span></span><span> </span><span id="local-6989586621681123411"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123411"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-144"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatches"><span class="hs-identifier hs-var">tcMatches</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123416"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType -&gt; Scaled ExpRhoType
forall a. Mult -&gt; a -&gt; Scaled a
</span><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-var">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123414"><span class="hs-identifier hs-var">scrut_mult</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123413"><span class="hs-identifier hs-var">scrut_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123411"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123412"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatchLambda"><span class="hs-identifier hs-type">tcMatchLambda</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-comment">-- see Note [Herald for matchExpectedFunTys] in GHC.Tc.Utils.Unify</span><span>
</span><span id="line-147"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-type">TcMatchCtxt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span>
</span><span id="line-148"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>
</span><span id="line-150"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier hs-type">HsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span id="tcMatchLambda"><span class="annot"><span class="annottext">tcMatchLambda :: SDoc
-&gt; TcMatchCtxt HsExpr
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; ExpRhoType
-&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
</span><a href="GHC.Tc.Gen.Match.html#tcMatchLambda"><span class="hs-identifier hs-var hs-var">tcMatchLambda</span></a></span></span><span> </span><span id="local-6989586621681123409"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681123409"><span class="hs-identifier hs-var">herald</span></a></span></span><span> </span><span id="local-6989586621681123408"><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
</span><a href="#local-6989586621681123408"><span class="hs-identifier hs-var">match_ctxt</span></a></span></span><span> </span><span id="local-6989586621681123407"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123407"><span class="hs-identifier hs-var">match</span></a></span></span><span> </span><span id="local-6989586621681123406"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123406"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-152"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
-&gt; UserTypeCtxt
-&gt; Arity
-&gt; ExpRhoType
-&gt; ([Scaled ExpRhoType]
    -&gt; ExpRhoType -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
forall a.
SDoc
-&gt; UserTypeCtxt
-&gt; Arity
-&gt; ExpRhoType
-&gt; ([Scaled ExpRhoType] -&gt; ExpRhoType -&gt; TcM a)
-&gt; TcM (HsWrapper, a)
</span><a href="GHC.Tc.Utils.Unify.html#matchExpectedFunTys"><span class="hs-identifier hs-var">matchExpectedFunTys</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681123409"><span class="hs-identifier hs-var">herald</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#GenSigCtxt"><span class="hs-identifier hs-var">GenSigCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681123405"><span class="hs-identifier hs-var">n_pats</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123406"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Scaled ExpRhoType]
  -&gt; ExpRhoType -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
 -&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; ([Scaled ExpRhoType]
    -&gt; ExpRhoType -&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc)))
-&gt; TcM (HsWrapper, MatchGroup GhcTc (LHsExpr GhcTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681123404"><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123404"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span id="local-6989586621681123403"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123403"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-153"></span><span>    </span><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (LHsExpr GhcRn)
-&gt; TcM (MatchGroup GhcTc (LHsExpr GhcTc))
forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatches"><span class="hs-identifier hs-var">tcMatches</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
</span><a href="#local-6989586621681123408"><span class="hs-identifier hs-var">match_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123404"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123403"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123407"><span class="hs-identifier hs-var">match</span></a></span><span>
</span><span id="line-154"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-155"></span><span>    </span><span id="local-6989586621681123405"><span class="annot"><span class="annottext">n_pats :: Arity
</span><a href="#local-6989586621681123405"><span class="hs-identifier hs-var hs-var">n_pats</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn) -&gt; Bool
forall id body. MatchGroup id body -&gt; Bool
</span><a href="GHC.Hs.Expr.html#isEmptyMatchGroup"><span class="hs-identifier hs-var">isEmptyMatchGroup</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123407"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">1</span></span><span>   </span><span class="hs-comment">-- must be lambda-case</span><span>
</span><span id="line-156"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn) -&gt; Arity
forall (id :: Pass) body. MatchGroup (GhcPass id) body -&gt; Arity
</span><a href="GHC.Hs.Expr.html#matchGroupArity"><span class="hs-identifier hs-var">matchGroupArity</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123407"><span class="hs-identifier hs-var">match</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- @tcGRHSsPat@ typechecks @[GRHSs]@ that occur in a @PatMonoBind@.</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGRHSsPat"><span class="hs-identifier hs-type">tcGRHSsPat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcRhoType"><span class="hs-identifier hs-type">TcRhoType</span></a></span><span>
</span><span id="line-161"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span class="hs-comment">-- Used for pattern bindings</span><span>
</span><span id="line-163"></span><span id="tcGRHSsPat"><span class="annot"><span class="annottext">tcGRHSsPat :: GRHSs GhcRn (LHsExpr GhcRn)
-&gt; Mult -&gt; TcM (GRHSs GhcTc (LHsExpr GhcTc))
</span><a href="GHC.Tc.Gen.Match.html#tcGRHSsPat"><span class="hs-identifier hs-var hs-var">tcGRHSsPat</span></a></span></span><span> </span><span id="local-6989586621681123400"><span class="annot"><span class="annottext">GRHSs GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123400"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span id="local-6989586621681123399"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123399"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
-&gt; GRHSs GhcRn (LHsExpr GhcRn)
-&gt; ExpRhoType
-&gt; TcM (GRHSs GhcTc (LHsExpr GhcTc))
forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; GRHSs GhcRn (Located (body GhcRn))
-&gt; ExpRhoType
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcGRHSs"><span class="hs-identifier hs-var">tcGRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt HsExpr
</span><a href="#local-6989586621681123397"><span class="hs-identifier hs-var">match_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123400"><span class="hs-identifier hs-var">grhss</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123399"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-165"></span><span>    </span><span id="local-6989586621681123397"><span class="annot"><span class="annottext">match_ctxt :: TcMatchCtxt HsExpr
</span><a href="#local-6989586621681123397"><span class="hs-identifier hs-var hs-var">match_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MC :: forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcRn)
    -&gt; ExpRhoType -&gt; TcM (Located (body GhcTc)))
-&gt; TcMatchCtxt body
</span><a href="GHC.Tc.Gen.Match.html#MC"><span class="hs-identifier hs-type">MC</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_what :: HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var">mc_what</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatBindRhs"><span class="hs-identifier hs-var">PatBindRhs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-166"></span><span>                      </span><span class="annot"><span class="annottext">mc_body :: LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#mc_body"><span class="hs-identifier hs-var">mc_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcBody"><span class="hs-identifier hs-var">tcBody</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-167"></span><span>
</span><span id="line-168"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                tcMatch
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-keyword">data</span><span> </span><span id="TcMatchCtxt"><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-var">TcMatchCtxt</span></a></span></span><span> </span><span id="local-6989586621681123811"><span class="annot"><a href="#local-6989586621681123811"><span class="hs-identifier hs-type">body</span></a></span></span><span>   </span><span class="hs-comment">-- c.f. TcStmtCtxt, also in this module</span><span>
</span><span id="line-175"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="MC"><span class="annot"><a href="GHC.Tc.Gen.Match.html#MC"><span class="hs-identifier hs-var">MC</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="mc_what"><span class="annot"><span class="annottext">forall (body :: * -&gt; *). TcMatchCtxt body -&gt; HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var hs-var">mc_what</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- What kind of thing this is</span><span>
</span><span id="line-176"></span><span>         </span><span id="mc_body"><span class="annot"><span class="annottext">forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; Located (body GhcRn) -&gt; ExpRhoType -&gt; TcM (Located (body GhcTc))
</span><a href="GHC.Tc.Gen.Match.html#mc_body"><span class="hs-identifier hs-var hs-var">mc_body</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123811"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- Type checker for a body of</span><span>
</span><span id="line-177"></span><span>                                           </span><span class="hs-comment">-- an alternative</span><span>
</span><span id="line-178"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>
</span><span id="line-179"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123811"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-comment">-- | Type-check a MatchGroup.</span><span>
</span><span id="line-182"></span><span id="local-6989586621681123819"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatches"><span class="hs-identifier hs-type">tcMatches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123819"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-type">TcMatchCtxt</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123819"><span class="hs-identifier hs-type">body</span></a></span><span>
</span><span id="line-183"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpSigmaType"><span class="hs-identifier hs-type">ExpSigmaType</span></a></span><span class="hs-special">]</span><span>      </span><span class="hs-comment">-- Expected pattern types</span><span>
</span><span id="line-184"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>                 </span><span class="hs-comment">-- Expected result-type of the Match.</span><span>
</span><span id="line-185"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123819"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123819"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span id="tcMatches"><span class="annot"><span class="annottext">tcMatches :: forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatches"><span class="hs-identifier hs-var hs-var">tcMatches</span></a></span></span><span> </span><span id="local-6989586621681123374"><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123374"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123373"><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123373"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span id="local-6989586621681123372"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123372"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123370"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123370"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123369"><span class="annot"><span class="annottext">[LMatch GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123369"><span class="hs-identifier hs-var">matches</span></a></span></span><span>
</span><span id="line-189"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: forall p body. MatchGroup p body -&gt; Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123367"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681123367"><span class="hs-identifier hs-var">origin</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn (Located (body GhcRn))] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123369"><span class="hs-identifier hs-var">matches</span></a></span><span>  </span><span class="hs-comment">-- Deal with case e of {}</span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-comment">-- Since there are no branches, no one else will fill in rhs_ty</span><span>
</span><span id="line-192"></span><span>    </span><span class="hs-comment">-- when in inference mode, so we must do it ourselves,</span><span>
</span><span id="line-193"></span><span>    </span><span class="hs-comment">-- here, using expTypeToType</span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">UsageEnv -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#tcEmitBindingUsage"><span class="hs-identifier hs-var">tcEmitBindingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">UsageEnv
</span><a href="GHC.Core.UsageEnv.html#bottomUE"><span class="hs-identifier hs-var">bottomUE</span></a></span><span>
</span><span id="line-195"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123363"><span class="annot"><span class="annottext">[Scaled Mult]
</span><a href="#local-6989586621681123363"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Scaled ExpRhoType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Scaled Mult))
-&gt; [Scaled ExpRhoType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Scaled Mult]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled ExpRhoType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Scaled Mult)
</span><a href="GHC.Tc.Utils.TcMType.html#scaledExpTypeToType"><span class="hs-identifier hs-var">scaledExpTypeToType</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123373"><span class="hs-identifier hs-var">pat_tys</span></a></span><span>
</span><span id="line-196"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123360"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123360"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#expTypeToType"><span class="hs-identifier hs-var">expTypeToType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123372"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-197"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (Located (body GhcTc))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located [LMatch GhcTc (Located (body GhcTc))]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LMatch GhcTc (Located (body GhcTc))]
-&gt; Located [LMatch GhcTc (Located (body GhcTc))]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123370"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-198"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled Mult] -&gt; Mult -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Mult]
</span><a href="#local-6989586621681123363"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123360"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-199"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681123367"><span class="hs-identifier hs-var">origin</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-202"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123356"><span class="annot"><span class="annottext">[(UsageEnv, LMatch GhcTc (Located (body GhcTc)))]
</span><a href="#local-6989586621681123356"><span class="hs-identifier hs-var">umatches</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LMatch GhcRn (Located (body GhcRn))
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (UsageEnv, LMatch GhcTc (Located (body GhcTc))))
-&gt; [LMatch GhcRn (Located (body GhcRn))]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     [(UsageEnv, LMatch GhcTc (Located (body GhcTc)))]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcM (LMatch GhcTc (Located (body GhcTc)))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (UsageEnv, LMatch GhcTc (Located (body GhcTc)))
forall a. TcM a -&gt; TcM (UsageEnv, a)
</span><a href="GHC.Tc.Utils.Monad.html#tcCollectingUsage"><span class="hs-identifier hs-var">tcCollectingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LMatch GhcTc (Located (body GhcTc)))
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (UsageEnv, LMatch GhcTc (Located (body GhcTc))))
-&gt; (LMatch GhcRn (Located (body GhcRn))
    -&gt; TcM (LMatch GhcTc (Located (body GhcTc))))
-&gt; LMatch GhcRn (Located (body GhcRn))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (UsageEnv, LMatch GhcTc (Located (body GhcTc)))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; LMatch GhcRn (Located (body GhcRn))
-&gt; TcM (LMatch GhcTc (Located (body GhcTc)))
forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; LMatch GhcRn (Located (body GhcRn))
-&gt; TcM (LMatch GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatch"><span class="hs-identifier hs-var">tcMatch</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123374"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123373"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123372"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123369"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-203"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123352"><span class="annot"><span class="annottext">[UsageEnv]
</span><a href="#local-6989586621681123352"><span class="hs-identifier hs-var">usages</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681123351"><span class="annot"><span class="annottext">[LMatch GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123351"><span class="hs-identifier hs-var">matches'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(UsageEnv, LMatch GhcTc (Located (body GhcTc)))]
-&gt; ([UsageEnv], [LMatch GhcTc (Located (body GhcTc))])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(UsageEnv, LMatch GhcTc (Located (body GhcTc)))]
</span><a href="#local-6989586621681123356"><span class="hs-identifier hs-var">umatches</span></a></span><span>
</span><span id="line-204"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">UsageEnv -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#tcEmitBindingUsage"><span class="hs-identifier hs-var">tcEmitBindingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">(UsageEnv -&gt; TcRn ()) -&gt; UsageEnv -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[UsageEnv] -&gt; UsageEnv
</span><a href="GHC.Core.UsageEnv.html#supUEs"><span class="hs-identifier hs-var">supUEs</span></a></span><span> </span><span class="annot"><span class="annottext">[UsageEnv]
</span><a href="#local-6989586621681123352"><span class="hs-identifier hs-var">usages</span></a></span><span>
</span><span id="line-205"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123348"><span class="annot"><span class="annottext">[Scaled Mult]
</span><a href="#local-6989586621681123348"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Scaled ExpRhoType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Scaled Mult))
-&gt; [Scaled ExpRhoType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Scaled Mult]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Scaled ExpRhoType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Scaled Mult)
</span><a href="GHC.Tc.Utils.TcMType.html#readScaledExpType"><span class="hs-identifier hs-var">readScaledExpType</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123373"><span class="hs-identifier hs-var">pat_tys</span></a></span><span>
</span><span id="line-206"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123346"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123346"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#readExpType"><span class="hs-identifier hs-var">readExpType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123372"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-207"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (Located (body GhcTc))
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located [LMatch GhcTc (Located (body GhcTc))]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LMatch GhcTc (Located (body GhcTc))]
-&gt; Located [LMatch GhcTc (Located (body GhcTc))]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123370"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123351"><span class="hs-identifier hs-var">matches'</span></a></span><span>
</span><span id="line-208"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled Mult] -&gt; Mult -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled Mult]
</span><a href="#local-6989586621681123348"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123346"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-209"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681123367"><span class="hs-identifier hs-var">origin</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-210"></span><span>
</span><span id="line-211"></span><span class="hs-comment">-------------</span><span>
</span><span id="line-212"></span><span id="local-6989586621681123766"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMatch"><span class="hs-identifier hs-type">tcMatch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123766"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-type">TcMatchCtxt</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123766"><span class="hs-identifier hs-type">body</span></a></span><span>
</span><span id="line-213"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpSigmaType"><span class="hs-identifier hs-type">ExpSigmaType</span></a></span><span class="hs-special">]</span><span>        </span><span class="hs-comment">-- Expected pattern types</span><span>
</span><span id="line-214"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>            </span><span class="hs-comment">-- Expected result-type of the Match.</span><span>
</span><span id="line-215"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123766"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123766"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span id="tcMatch"><span class="annot"><span class="annottext">tcMatch :: forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; LMatch GhcRn (Located (body GhcRn))
-&gt; TcM (LMatch GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatch"><span class="hs-identifier hs-var hs-var">tcMatch</span></a></span></span><span> </span><span id="local-6989586621681123336"><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123336"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123335"><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123335"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span id="local-6989586621681123334"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123334"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span id="local-6989586621681123333"><span class="annot"><span class="annottext">LMatch GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123333"><span class="hs-identifier hs-var">match</span></a></span></span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Match GhcRn (Located (body GhcRn))
 -&gt; TcM (Match GhcTc (Located (body GhcTc))))
-&gt; LMatch GhcRn (Located (body GhcRn))
-&gt; TcM (Located (Match GhcTc (Located (body GhcTc))))
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; Match GhcRn (Located (body GhcRn))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123331"><span class="hs-identifier hs-var">tc_match</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123336"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123335"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123334"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LMatch GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123333"><span class="hs-identifier hs-var">match</span></a></span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-221"></span><span>    </span><span id="local-6989586621681123331"><span class="annot"><span class="annottext">tc_match :: TcMatchCtxt body
-&gt; [Scaled ExpRhoType]
-&gt; ExpRhoType
-&gt; Match GhcRn (Located (body GhcRn))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123331"><span class="hs-identifier hs-var hs-var">tc_match</span></a></span></span><span> </span><span id="local-6989586621681123330"><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123330"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123329"><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123329"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span id="local-6989586621681123328"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123328"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span>
</span><span id="line-222"></span><span>             </span><span id="local-6989586621681123327"><span class="annot"><span class="annottext">match :: Match GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123327"><span class="hs-identifier hs-var">match</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123324"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681123324"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123322"><span class="annot"><span class="annottext">GRHSs GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123322"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Match GhcRn (Located (body GhcRn))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123321"><span class="hs-identifier hs-var">add_match_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Match GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123327"><span class="hs-identifier hs-var">match</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Match GhcTc (Located (body GhcTc)))
 -&gt; TcM (Match GhcTc (Located (body GhcTc))))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-224"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123320"><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
</span><a href="#local-6989586621681123320"><span class="hs-identifier hs-var">pats'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123319"><span class="annot"><span class="annottext">GRHSs GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123319"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; [LPat GhcRn]
-&gt; [Scaled ExpRhoType]
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
-&gt; TcM ([LPat GhcTc], GRHSs GhcTc (Located (body GhcTc)))
forall a.
HsMatchContext GhcRn
-&gt; [LPat GhcRn]
-&gt; [Scaled ExpRhoType]
-&gt; TcM a
-&gt; TcM ([LPat GhcTc], a)
</span><a href="GHC.Tc.Gen.Pat.html#tcPats"><span class="hs-identifier hs-var">tcPats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcMatchCtxt body -&gt; HsMatchContext GhcRn
forall (body :: * -&gt; *). TcMatchCtxt body -&gt; HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var hs-var">mc_what</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123330"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681123324"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled ExpRhoType]
</span><a href="#local-6989586621681123329"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (GRHSs GhcTc (Located (body GhcTc)))
 -&gt; TcM ([LPat GhcTc], GRHSs GhcTc (Located (body GhcTc))))
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
-&gt; TcM ([LPat GhcTc], GRHSs GhcTc (Located (body GhcTc)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-225"></span><span>                                </span><span class="annot"><span class="annottext">TcMatchCtxt body
-&gt; GRHSs GhcRn (Located (body GhcRn))
-&gt; ExpRhoType
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; GRHSs GhcRn (Located (body GhcRn))
-&gt; ExpRhoType
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcGRHSs"><span class="hs-identifier hs-var">tcGRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123330"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123322"><span class="hs-identifier hs-var">grhss</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123328"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-226"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Match GhcTc (Located (body GhcTc))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match :: forall p body.
XCMatch p body
-&gt; HsMatchContext (NoGhcTc p)
-&gt; [LPat p]
-&gt; GRHSs p body
-&gt; Match p body
</span><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_ext :: XCMatch GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Expr.html#m_ext"><span class="hs-identifier hs-var">m_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XCMatch GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-227"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_ctxt :: HsMatchContext (NoGhcTc GhcTc)
</span><a href="GHC.Hs.Expr.html#m_ctxt"><span class="hs-identifier hs-var">m_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body -&gt; HsMatchContext GhcRn
forall (body :: * -&gt; *). TcMatchCtxt body -&gt; HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var hs-var">mc_what</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123330"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_pats :: [LPat GhcTc]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681123320"><span class="hs-identifier hs-var">pats'</span></a></span><span>
</span><span id="line-228"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: GRHSs GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123319"><span class="hs-identifier hs-var">grhss'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span>        </span><span class="hs-comment">-- For (\x -&gt; e), tcExpr has already said &quot;In the expression \x-&gt;e&quot;</span><span>
</span><span id="line-231"></span><span>        </span><span class="hs-comment">-- so we don't want to add &quot;In the lambda abstraction \x-&gt;e&quot;</span><span>
</span><span id="line-232"></span><span>    </span><span id="local-6989586621681123321"><span class="annot"><span class="annottext">add_match_ctxt :: Match GhcRn (Located (body GhcRn))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123321"><span class="hs-identifier hs-var hs-var">add_match_ctxt</span></a></span></span><span> </span><span id="local-6989586621681123315"><span class="annot"><span class="annottext">Match GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123315"><span class="hs-identifier hs-var">match</span></a></span></span><span> </span><span id="local-6989586621681123314"><span class="annot"><span class="annottext">TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123314"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-233"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body -&gt; HsMatchContext GhcRn
forall (body :: * -&gt; *). TcMatchCtxt body -&gt; HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var hs-var">mc_what</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123336"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-234"></span><span>            </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123314"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-235"></span><span>            </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
-&gt; TcM (Match GhcTc (Located (body GhcTc)))
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match GhcRn (Located (body GhcRn)) -&gt; SDoc
forall (idR :: Pass) body.
(OutputableBndrId idR, Outputable body) =&gt;
Match (GhcPass idR) body -&gt; SDoc
</span><a href="GHC.Hs.Expr.html#pprMatchInCtxt"><span class="hs-identifier hs-var">pprMatchInCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Match GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123315"><span class="hs-identifier hs-var">match</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcM (Match GhcTc (Located (body GhcTc)))
</span><a href="#local-6989586621681123314"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-236"></span><span>
</span><span id="line-237"></span><span class="hs-comment">-------------</span><span>
</span><span id="line-238"></span><span id="local-6989586621681123793"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGRHSs"><span class="hs-identifier hs-type">tcGRHSs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-type">TcMatchCtxt</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123793"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123793"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>
</span><span id="line-239"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123793"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="hs-comment">-- Notice that we pass in the full res_ty, so that we get</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- good inference from simple things like</span><span>
</span><span id="line-243"></span><span class="hs-comment">--      f = \(x::forall a.a-&gt;a) -&gt; &lt;stuff&gt;</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- We used to force it to be a monotype when there was more than one guard</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- but we don't need to do that any more</span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span id="tcGRHSs"><span class="annot"><span class="annottext">tcGRHSs :: forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; GRHSs GhcRn (Located (body GhcRn))
-&gt; ExpRhoType
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcGRHSs"><span class="hs-identifier hs-var hs-var">tcGRHSs</span></a></span></span><span> </span><span id="local-6989586621681123305"><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123305"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs GhcRn (Located (body GhcRn))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123303"><span class="annot"><span class="annottext">[LGRHS GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123303"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123302"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123302"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123301"><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681123301"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123300"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123300"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-248"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123299"><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681123299"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123298"><span class="annot"><span class="annottext">[(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
</span><a href="#local-6989586621681123298"><span class="hs-identifier hs-var">ugrhss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
-&gt; TcM [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
-&gt; TcM
     (HsLocalBinds GhcTc,
      [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))])
forall thing.
HsLocalBinds GhcRn -&gt; TcM thing -&gt; TcM (HsLocalBinds GhcTc, thing)
</span><a href="GHC.Tc.Gen.Bind.html#tcLocalBinds"><span class="hs-identifier hs-var">tcLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681123301"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
 -&gt; TcM
      (HsLocalBinds GhcTc,
       [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]))
-&gt; TcM [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
-&gt; TcM
     (HsLocalBinds GhcTc,
      [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-250"></span><span>               </span><span class="annot"><span class="annottext">(LGRHS GhcRn (Located (body GhcRn))
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (UsageEnv, Located (GRHS GhcTc (Located (body GhcTc)))))
-&gt; [LGRHS GhcRn (Located (body GhcRn))]
-&gt; TcM [(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcM (Located (GRHS GhcTc (Located (body GhcTc))))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))
forall a. TcM a -&gt; TcM (UsageEnv, a)
</span><a href="GHC.Tc.Utils.Monad.html#tcCollectingUsage"><span class="hs-identifier hs-var">tcCollectingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Located (GRHS GhcTc (Located (body GhcTc))))
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (UsageEnv, Located (GRHS GhcTc (Located (body GhcTc)))))
-&gt; (LGRHS GhcRn (Located (body GhcRn))
    -&gt; TcM (Located (GRHS GhcTc (Located (body GhcTc)))))
-&gt; LGRHS GhcRn (Located (body GhcRn))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(GRHS GhcRn (Located (body GhcRn))
 -&gt; TcM (GRHS GhcTc (Located (body GhcTc))))
-&gt; LGRHS GhcRn (Located (body GhcRn))
-&gt; TcM (Located (GRHS GhcTc (Located (body GhcTc))))
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcMatchCtxt body
-&gt; ExpRhoType
-&gt; GRHS GhcRn (Located (body GhcRn))
-&gt; TcM (GRHS GhcTc (Located (body GhcTc)))
forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; ExpRhoType
-&gt; GRHS GhcRn (Located (body GhcRn))
-&gt; TcM (GRHS GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcGRHS"><span class="hs-identifier hs-var">tcGRHS</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123305"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123300"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123303"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123296"><span class="annot"><span class="annottext">[UsageEnv]
</span><a href="#local-6989586621681123296"><span class="hs-identifier hs-var">usages</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123295"><span class="annot"><span class="annottext">[Located (GRHS GhcTc (Located (body GhcTc)))]
</span><a href="#local-6989586621681123295"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
-&gt; ([UsageEnv], [Located (GRHS GhcTc (Located (body GhcTc)))])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(UsageEnv, Located (GRHS GhcTc (Located (body GhcTc))))]
</span><a href="#local-6989586621681123298"><span class="hs-identifier hs-var">ugrhss</span></a></span><span>
</span><span id="line-252"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">UsageEnv -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#tcEmitBindingUsage"><span class="hs-identifier hs-var">tcEmitBindingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">(UsageEnv -&gt; TcRn ()) -&gt; UsageEnv -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[UsageEnv] -&gt; UsageEnv
</span><a href="GHC.Core.UsageEnv.html#supUEs"><span class="hs-identifier hs-var">supUEs</span></a></span><span> </span><span class="annot"><span class="annottext">[UsageEnv]
</span><a href="#local-6989586621681123296"><span class="hs-identifier hs-var">usages</span></a></span><span>
</span><span id="line-253"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (Located (body GhcTc))
-&gt; TcM (GRHSs GhcTc (Located (body GhcTc)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHSs GhcTc (Located (body GhcTc))
-&gt; [Located (GRHS GhcTc (Located (body GhcTc)))]
-&gt; LHsLocalBinds GhcTc
-&gt; GRHSs GhcTc (Located (body GhcTc))
forall p body.
XCGRHSs p body -&gt; [LGRHS p body] -&gt; LHsLocalBinds p -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-var">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCGRHSs GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (GRHS GhcTc (Located (body GhcTc)))]
</span><a href="#local-6989586621681123295"><span class="hs-identifier hs-var">grhss'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsLocalBinds GhcTc -&gt; LHsLocalBinds GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123302"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681123299"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-------------</span><span>
</span><span id="line-256"></span><span id="local-6989586621681123738"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGRHS"><span class="hs-identifier hs-type">tcGRHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcMatchCtxt"><span class="hs-identifier hs-type">TcMatchCtxt</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123738"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123738"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123738"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span id="tcGRHS"><span class="annot"><span class="annottext">tcGRHS :: forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; ExpRhoType
-&gt; GRHS GhcRn (Located (body GhcRn))
-&gt; TcM (GRHS GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcGRHS"><span class="hs-identifier hs-var hs-var">tcGRHS</span></a></span></span><span> </span><span id="local-6989586621681123291"><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123291"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123290"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123290"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS GhcRn (Located (body GhcRn))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123288"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123288"><span class="hs-identifier hs-var">guards</span></a></span></span><span> </span><span id="local-6989586621681123287"><span class="annot"><span class="annottext">Located (body GhcRn)
</span><a href="#local-6989586621681123287"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123286"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123286"><span class="hs-identifier hs-var">guards'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123285"><span class="annot"><span class="annottext">Located (body GhcTc)
</span><a href="#local-6989586621681123285"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-261"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM (Located (body GhcTc)))
-&gt; TcM ([LStmt GhcTc (LHsExpr GhcTc)], Located (body GhcTc))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123284"><span class="hs-identifier hs-var">stmt_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier hs-var">tcGuardStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123288"><span class="hs-identifier hs-var">guards</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123290"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM (Located (body GhcTc)))
 -&gt; TcM ([LStmt GhcTc (LHsExpr GhcTc)], Located (body GhcTc)))
-&gt; (ExpRhoType -&gt; TcM (Located (body GhcTc)))
-&gt; TcM ([LStmt GhcTc (LHsExpr GhcTc)], Located (body GhcTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-262"></span><span>               </span><span class="annot"><span class="annottext">TcMatchCtxt body
-&gt; Located (body GhcRn) -&gt; ExpRhoType -&gt; TcM (Located (body GhcTc))
forall (body :: * -&gt; *).
TcMatchCtxt body
-&gt; Located (body GhcRn) -&gt; ExpRhoType -&gt; TcM (Located (body GhcTc))
</span><a href="GHC.Tc.Gen.Match.html#mc_body"><span class="hs-identifier hs-var hs-var">mc_body</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123291"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcRn)
</span><a href="#local-6989586621681123287"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-263"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">GRHS GhcTc (Located (body GhcTc))
-&gt; TcM (GRHS GhcTc (Located (body GhcTc)))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHS GhcTc (Located (body GhcTc))
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; Located (body GhcTc)
-&gt; GRHS GhcTc (Located (body GhcTc))
forall p body.
XCGRHS p body -&gt; [GuardLStmt p] -&gt; body -&gt; GRHS p body
</span><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-var">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCGRHS GhcTc (Located (body GhcTc))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123286"><span class="hs-identifier hs-var">guards'</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcTc)
</span><a href="#local-6989586621681123285"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-265"></span><span>    </span><span id="local-6989586621681123284"><span class="annot"><span class="annottext">stmt_ctxt :: HsStmtContext GhcRn
</span><a href="#local-6989586621681123284"><span class="hs-identifier hs-var hs-var">stmt_ctxt</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; HsStmtContext GhcRn
forall p. HsMatchContext p -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#PatGuard"><span class="hs-identifier hs-var">PatGuard</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcMatchCtxt body -&gt; HsMatchContext GhcRn
forall (body :: * -&gt; *). TcMatchCtxt body -&gt; HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var hs-var">mc_what</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt body
</span><a href="#local-6989586621681123291"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{@tcDoStmts@ typechecks a {\em list} of do statements}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier hs-type">tcDoStmts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsStmtContext"><span class="hs-identifier hs-type">HsStmtContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-276"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-277"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>
</span><span id="line-278"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>          </span><span class="hs-comment">-- Returns a HsDo</span><span>
</span><span id="line-279"></span><span id="tcDoStmts"><span class="annot"><span class="annottext">tcDoStmts :: HsStmtContext GhcRn
-&gt; Located [GuardLStmt GhcRn] -&gt; ExpRhoType -&gt; TcM (HsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier hs-var hs-var">tcDoStmts</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="GHC.Hs.Expr.html#ListComp"><span class="hs-identifier hs-var">ListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123281"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123281"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123280"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123280"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123279"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123279"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-280"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123278"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123278"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#expTypeToType"><span class="hs-identifier hs-var">expTypeToType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123279"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-281"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123277"><span class="annot"><span class="annottext">TcCoercionN
</span><a href="#local-6989586621681123277"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123276"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123276"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM (TcCoercionN, Mult)
</span><a href="GHC.Tc.Utils.Unify.html#matchExpectedListTy"><span class="hs-identifier hs-var">matchExpectedListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123278"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-282"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681123274"><span class="annot"><span class="annottext">list_ty :: Mult
</span><a href="#local-6989586621681123274"><span class="hs-identifier hs-var hs-var">list_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="GHC.Builtin.Types.html#mkListTy"><span class="hs-identifier hs-var">mkListTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123276"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-283"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123272"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123272"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; TcM [LStmt GhcTc (LHsExpr GhcTc)]
forall (body :: * -&gt; *) rho_type.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
</span><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-var">tcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#ListComp"><span class="hs-identifier hs-var">ListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#listTyCon"><span class="hs-identifier hs-var">listTyCon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123280"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-284"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123276"><span class="hs-identifier hs-var">elt_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; TcM (HsExpr GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc -&gt; TcM (HsExpr GhcTc))
-&gt; HsExpr GhcTc -&gt; TcM (HsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionN -&gt; HsExpr GhcTc -&gt; HsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsWrapCo"><span class="hs-identifier hs-var">mkHsWrapCo</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionN
</span><a href="#local-6989586621681123277"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XDo GhcTc
-&gt; HsStmtContext GhcRn
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; HsExpr GhcTc
forall p.
XDo p -&gt; HsStmtContext GhcRn -&gt; Located [ExprLStmt p] -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsDo"><span class="hs-identifier hs-var">HsDo</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XDo GhcTc
</span><a href="#local-6989586621681123274"><span class="hs-identifier hs-var">list_ty</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#ListComp"><span class="hs-identifier hs-var">ListComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123281"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123272"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier hs-var">tcDoStmts</span></a></span><span> </span><span id="local-6989586621681123267"><span class="annot"><span class="annottext">doExpr :: HsStmtContext GhcRn
</span><a href="#local-6989586621681123267"><span class="hs-identifier hs-var">doExpr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#DoExpr"><span class="hs-identifier hs-type">DoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123265"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123265"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123264"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123264"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123263"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123263"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-288"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123262"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123262"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; TcM [LStmt GhcTc (LHsExpr GhcTc)]
forall (body :: * -&gt; *) rho_type.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
</span><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-var">tcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123267"><span class="hs-identifier hs-var">doExpr</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123264"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123263"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-289"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123261"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123261"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#readExpType"><span class="hs-identifier hs-var">readExpType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123263"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-290"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; TcM (HsExpr GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XDo GhcTc
-&gt; HsStmtContext GhcRn
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; HsExpr GhcTc
forall p.
XDo p -&gt; HsStmtContext GhcRn -&gt; Located [ExprLStmt p] -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsDo"><span class="hs-identifier hs-var">HsDo</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XDo GhcTc
</span><a href="#local-6989586621681123261"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123267"><span class="hs-identifier hs-var">doExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123265"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123262"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier hs-var">tcDoStmts</span></a></span><span> </span><span id="local-6989586621681123260"><span class="annot"><span class="annottext">mDoExpr :: HsStmtContext GhcRn
</span><a href="#local-6989586621681123260"><span class="hs-identifier hs-var">mDoExpr</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MDoExpr"><span class="hs-identifier hs-type">MDoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123258"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123258"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123257"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123257"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123256"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123256"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-293"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123255"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123255"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; TcM [LStmt GhcTc (LHsExpr GhcTc)]
forall (body :: * -&gt; *) rho_type.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
</span><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-var">tcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123260"><span class="hs-identifier hs-var">mDoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123257"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123256"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-294"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123254"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123254"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#readExpType"><span class="hs-identifier hs-var">readExpType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123256"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; TcM (HsExpr GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XDo GhcTc
-&gt; HsStmtContext GhcRn
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; HsExpr GhcTc
forall p.
XDo p -&gt; HsStmtContext GhcRn -&gt; Located [ExprLStmt p] -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsDo"><span class="hs-identifier hs-var">HsDo</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XDo GhcTc
</span><a href="#local-6989586621681123254"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123260"><span class="hs-identifier hs-var">mDoExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123258"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123255"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier hs-var">tcDoStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="GHC.Hs.Expr.html#MonadComp"><span class="hs-identifier hs-var">MonadComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123252"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123252"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123251"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123251"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123250"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123250"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-298"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123249"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123249"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; TcM [LStmt GhcTc (LHsExpr GhcTc)]
forall (body :: * -&gt; *) rho_type.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
</span><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-var">tcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#MonadComp"><span class="hs-identifier hs-var">MonadComp</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123251"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123250"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-299"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123247"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123247"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#readExpType"><span class="hs-identifier hs-var">readExpType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123250"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-300"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; TcM (HsExpr GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XDo GhcTc
-&gt; HsStmtContext GhcRn
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; HsExpr GhcTc
forall p.
XDo p -&gt; HsStmtContext GhcRn -&gt; Located [ExprLStmt p] -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsDo"><span class="hs-identifier hs-var">HsDo</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XDo GhcTc
</span><a href="#local-6989586621681123247"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#MonadComp"><span class="hs-identifier hs-var">MonadComp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; Located [LStmt GhcTc (LHsExpr GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123252"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123249"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmts"><span class="hs-identifier hs-var">tcDoStmts</span></a></span><span> </span><span id="local-6989586621681123246"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123246"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="annot"><span class="annottext">Located [GuardLStmt GhcRn]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (HsExpr GhcTc)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcDoStmts&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; SDoc
forall id. Outputable (IdP id) =&gt; HsStmtContext id -&gt; SDoc
</span><a href="GHC.Hs.Expr.html#pprStmtContext"><span class="hs-identifier hs-var">pprStmtContext</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123246"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcBody"><span class="hs-identifier hs-type">tcBody</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span id="tcBody"><span class="annot"><span class="annottext">tcBody :: LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcBody"><span class="hs-identifier hs-var hs-var">tcBody</span></a></span></span><span> </span><span id="local-6989586621681123243"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123243"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681123242"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123242"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-306"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcBody&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExpRhoType -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123242"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcMonoExpr"><span class="hs-identifier hs-var">tcMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123243"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123242"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-308"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{tcStmts}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span class="hs-keyword">type</span><span> </span><span id="TcExprStmtChecker"><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcExprStmtChecker"><span class="hs-identifier hs-var">TcExprStmtChecker</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcStmtChecker"><span class="hs-identifier hs-type">TcStmtChecker</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>
</span><span id="line-319"></span><span class="hs-keyword">type</span><span> </span><span id="TcCmdStmtChecker"><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcCmdStmtChecker"><span class="hs-identifier hs-var">TcCmdStmtChecker</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcStmtChecker"><span class="hs-identifier hs-type">TcStmtChecker</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmd"><span class="hs-identifier hs-type">HsCmd</span></a></span><span>  </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcRhoType"><span class="hs-identifier hs-type">TcRhoType</span></a></span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span class="hs-keyword">type</span><span> </span><span id="TcStmtChecker"><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcStmtChecker"><span class="hs-identifier hs-var">TcStmtChecker</span></a></span></span><span> </span><span id="local-6989586621681123240"><span class="annot"><a href="#local-6989586621681123240"><span class="hs-identifier hs-type">body</span></a></span></span><span> </span><span id="local-6989586621681123239"><span class="annot"><a href="#local-6989586621681123239"><span class="hs-identifier hs-type">rho_type</span></a></span></span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681123238"><span class="annot"><a href="#local-6989586621681123238"><span class="hs-identifier hs-type">thing</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsStmtContext"><span class="hs-identifier hs-type">HsStmtContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-323"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123240"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681123239"><span class="hs-identifier hs-type">rho_type</span></a></span><span>                 </span><span class="hs-comment">-- Result type for comprehension</span><span>
</span><span id="line-325"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123239"><span class="hs-identifier hs-type">rho_type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123238"><span class="hs-identifier hs-type">thing</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Checker for what follows the stmt</span><span>
</span><span id="line-326"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Stmt"><span class="hs-identifier hs-type">Stmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123240"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681123238"><span class="hs-identifier hs-type">thing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-327"></span><span>
</span><span id="line-328"></span><span id="local-6989586621681123720"><span id="local-6989586621681123721"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-type">tcStmts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123721"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsStmtContext"><span class="hs-identifier hs-type">HsStmtContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-329"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcStmtChecker"><span class="hs-identifier hs-type">TcStmtChecker</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123721"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123720"><span class="hs-identifier hs-type">rho_type</span></a></span><span>   </span><span class="hs-comment">-- NB: higher-rank type</span><span>
</span><span id="line-330"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123721"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-331"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681123720"><span class="hs-identifier hs-type">rho_type</span></a></span><span>
</span><span id="line-332"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123721"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span></span></span><span>
</span><span id="line-333"></span><span id="tcStmts"><span class="annot"><span class="annottext">tcStmts :: forall (body :: * -&gt; *) rho_type.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
</span><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-var hs-var">tcStmts</span></a></span></span><span> </span><span id="local-6989586621681123232"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123232"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123231"><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123231"><span class="hs-identifier hs-var">stmt_chk</span></a></span></span><span> </span><span id="local-6989586621681123230"><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123230"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681123229"><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123229"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-334"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123228"><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123228"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcRn ())
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], ())
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123232"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123231"><span class="hs-identifier hs-var">stmt_chk</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123230"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123229"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((rho_type -&gt; TcRn ())
 -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], ()))
-&gt; (rho_type -&gt; TcRn ())
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-335"></span><span>                        </span><span class="annot"><span class="annottext">TcRn () -&gt; rho_type -&gt; TcRn ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123228"><span class="hs-identifier hs-var">stmts'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span id="local-6989586621681123726"><span id="local-6989586621681123727"><span id="local-6989586621681123728"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-type">tcStmtsAndThen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123728"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsStmtContext"><span class="hs-identifier hs-type">HsStmtContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-339"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcStmtChecker"><span class="hs-identifier hs-type">TcStmtChecker</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123728"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123727"><span class="hs-identifier hs-type">rho_type</span></a></span><span>    </span><span class="hs-comment">-- NB: higher-rank type</span><span>
</span><span id="line-340"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123728"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-341"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681123727"><span class="hs-identifier hs-type">rho_type</span></a></span><span>
</span><span id="line-342"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123727"><span class="hs-identifier hs-type">rho_type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123726"><span class="hs-identifier hs-type">thing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmt"><span class="hs-identifier hs-type">LStmt</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681123728"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681123726"><span class="hs-identifier hs-type">thing</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-comment">-- Note the higher-rank type.  stmt_chk is applied at different</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- types in the equations for tcStmts</span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span id="tcStmtsAndThen"><span class="annot"><span class="annottext">tcStmtsAndThen :: forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var hs-var">tcStmtsAndThen</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681123210"><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123210"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681123209"><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123209"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-349"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123208"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123208"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123209"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123210"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-350"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123208"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span class="hs-comment">-- LetStmts are handled uniformly, regardless of context</span><span>
</span><span id="line-353"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span id="local-6989586621681123207"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123207"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123206"><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123206"><span class="hs-identifier hs-var">stmt_chk</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123205"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123205"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-type">LetStmt</span></a></span><span> </span><span id="local-6989586621681123203"><span class="annot"><span class="annottext">XLetStmt GhcRn GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123203"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123202"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123202"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681123201"><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681123201"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681123200"><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123200"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span>                                                             </span><span id="local-6989586621681123199"><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123199"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681123198"><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123198"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123197"><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681123197"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123196"><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123196"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681123195"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123195"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM
     (HsLocalBinds GhcTc, ([LStmt GhcTc (Located (body GhcTc))], thing))
forall thing.
HsLocalBinds GhcRn -&gt; TcM thing -&gt; TcM (HsLocalBinds GhcTc, thing)
</span><a href="GHC.Tc.Gen.Bind.html#tcLocalBinds"><span class="hs-identifier hs-var">tcLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681123201"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
 -&gt; TcM
      (HsLocalBinds GhcTc,
       ([LStmt GhcTc (Located (body GhcTc))], thing)))
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM
     (HsLocalBinds GhcTc, ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-356"></span><span>              </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123207"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123206"><span class="hs-identifier hs-var">stmt_chk</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123200"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123199"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123198"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-357"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; StmtLR GhcTc GhcTc (Located (body GhcTc))
-&gt; LStmt GhcTc (Located (body GhcTc))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123205"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XLetStmt GhcTc GhcTc (Located (body GhcTc))
-&gt; LHsLocalBinds GhcTc -&gt; StmtLR GhcTc GhcTc (Located (body GhcTc))
forall idL idR body.
XLetStmt idL idR body
-&gt; LHsLocalBindsLR idL idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LetStmt"><span class="hs-identifier hs-var">LetStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLetStmt GhcRn GhcRn (Located (body GhcRn))
XLetStmt GhcTc GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123203"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsLocalBinds GhcTc -&gt; LHsLocalBinds GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123202"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681123197"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LStmt GhcTc (Located (body GhcTc))
-&gt; [LStmt GhcTc (Located (body GhcTc))]
-&gt; [LStmt GhcTc (Located (body GhcTc))]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123196"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123195"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span class="hs-comment">-- Don't set the error context for an ApplicativeStmt.  It ought to be</span><span>
</span><span id="line-360"></span><span class="hs-comment">-- possible to do this with a popErrCtxt in the tcStmt case for</span><span>
</span><span id="line-361"></span><span class="hs-comment">-- ApplicativeStmt, but it did something strange and broke a test (ado002).</span><span>
</span><span id="line-362"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span id="local-6989586621681123194"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123194"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681123193"><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123193"><span class="hs-identifier hs-var">stmt_chk</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681123192"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123192"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681123191"><span class="annot"><span class="annottext">StmtLR GhcRn GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123191"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681123190"><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123190"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123189"><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123189"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681123188"><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123188"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeStmt"><span class="hs-identifier hs-type">ApplicativeStmt</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">StmtLR GhcRn GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123191"><span class="hs-identifier hs-var">stmt</span></a></span><span>
</span><span id="line-364"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123186"><span class="annot"><span class="annottext">StmtLR GhcTc GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123186"><span class="hs-identifier hs-var">stmt'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123185"><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123185"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123184"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123184"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-365"></span><span>             </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; StmtLR GhcRn GhcRn (Located (body GhcRn))
-&gt; rho_type
-&gt; (rho_type -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
TcStmtChecker body rho_type
</span><a href="#local-6989586621681123193"><span class="hs-identifier hs-var">stmt_chk</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123194"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR GhcRn GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123191"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123189"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((rho_type -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
 -&gt; TcM
      (StmtLR GhcTc GhcTc (Located (body GhcTc)),
       ([LStmt GhcTc (Located (body GhcTc))], thing)))
-&gt; (rho_type -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681123183"><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123183"><span class="hs-identifier hs-var">res_ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-366"></span><span>               </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123194"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123193"><span class="hs-identifier hs-var">stmt_chk</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123190"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123183"><span class="hs-identifier hs-var">res_ty'</span></a></span><span>  </span><span class="annot"><span class="annottext">((rho_type -&gt; TcM thing)
 -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-367"></span><span>                 </span><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123188"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-368"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; StmtLR GhcTc GhcTc (Located (body GhcTc))
-&gt; LStmt GhcTc (Located (body GhcTc))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123192"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR GhcTc GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123186"><span class="hs-identifier hs-var">stmt'</span></a></span><span> </span><span class="annot"><span class="annottext">LStmt GhcTc (Located (body GhcTc))
-&gt; [LStmt GhcTc (Located (body GhcTc))]
-&gt; [LStmt GhcTc (Located (body GhcTc))]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123185"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123184"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-comment">-- For the vanilla case, handle the location-setting part</span><span>
</span><span id="line-371"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-372"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123182"><span class="annot"><span class="annottext">StmtLR GhcTc GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123182"><span class="hs-identifier hs-var">stmt'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123181"><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123181"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123180"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123180"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-373"></span><span>                </span><span class="annot"><span class="annottext">SrcSpan
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123192"><span class="hs-identifier hs-var">loc</span></a></span><span>                              </span><span class="annot"><span class="annottext">(TcM
   (StmtLR GhcTc GhcTc (Located (body GhcTc)),
    ([LStmt GhcTc (Located (body GhcTc))], thing))
 -&gt; TcM
      (StmtLR GhcTc GhcTc (Located (body GhcTc)),
       ([LStmt GhcTc (Located (body GhcTc))], thing)))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-374"></span><span>                </span><span class="annot"><span class="annottext">SDoc
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; StmtLR GhcRn GhcRn (Located (body GhcRn)) -&gt; SDoc
forall (idL :: Pass) (idR :: Pass) body.
(OutputableBndrId idL, OutputableBndrId idR, Outputable body) =&gt;
HsStmtContext (GhcPass idL)
-&gt; StmtLR (GhcPass idL) (GhcPass idR) body -&gt; SDoc
</span><a href="GHC.Hs.Expr.html#pprStmtInCtxt"><span class="hs-identifier hs-var">pprStmtInCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123194"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR GhcRn GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123191"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>        </span><span class="annot"><span class="annottext">(TcM
   (StmtLR GhcTc GhcTc (Located (body GhcTc)),
    ([LStmt GhcTc (Located (body GhcTc))], thing))
 -&gt; TcM
      (StmtLR GhcTc GhcTc (Located (body GhcTc)),
       ([LStmt GhcTc (Located (body GhcTc))], thing)))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-375"></span><span>                </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; StmtLR GhcRn GhcRn (Located (body GhcRn))
-&gt; rho_type
-&gt; (rho_type -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
TcStmtChecker body rho_type
</span><a href="#local-6989586621681123193"><span class="hs-identifier hs-var">stmt_chk</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123194"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR GhcRn GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681123191"><span class="hs-identifier hs-var">stmt</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123189"><span class="hs-identifier hs-var">res_ty</span></a></span><span>                   </span><span class="annot"><span class="annottext">((rho_type -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
 -&gt; TcM
      (StmtLR GhcTc GhcTc (Located (body GhcTc)),
       ([LStmt GhcTc (Located (body GhcTc))], thing)))
-&gt; (rho_type -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM
     (StmtLR GhcTc GhcTc (Located (body GhcTc)),
      ([LStmt GhcTc (Located (body GhcTc))], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681123177"><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123177"><span class="hs-identifier hs-var">res_ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-376"></span><span>                </span><span class="annot"><span class="annottext">TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#popErrCtxt"><span class="hs-identifier hs-var">popErrCtxt</span></a></span><span>                                  </span><span class="annot"><span class="annottext">(TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
 -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-377"></span><span>                </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123194"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker body rho_type
</span><a href="#local-6989586621681123193"><span class="hs-identifier hs-var">stmt_chk</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681123190"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">rho_type
</span><a href="#local-6989586621681123177"><span class="hs-identifier hs-var">res_ty'</span></a></span><span>  </span><span class="annot"><span class="annottext">((rho_type -&gt; TcM thing)
 -&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing))
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-378"></span><span>                </span><span class="annot"><span class="annottext">rho_type -&gt; TcM thing
</span><a href="#local-6989586621681123188"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-379"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LStmt GhcTc (Located (body GhcTc))], thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; StmtLR GhcTc GhcTc (Located (body GhcTc))
-&gt; LStmt GhcTc (Located (body GhcTc))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681123192"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">StmtLR GhcTc GhcTc (Located (body GhcTc))
</span><a href="#local-6989586621681123182"><span class="hs-identifier hs-var">stmt'</span></a></span><span> </span><span class="annot"><span class="annottext">LStmt GhcTc (Located (body GhcTc))
-&gt; [LStmt GhcTc (Located (body GhcTc))]
-&gt; [LStmt GhcTc (Located (body GhcTc))]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (Located (body GhcTc))]
</span><a href="#local-6989586621681123181"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123180"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-380"></span><span>
</span><span id="line-381"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-382"></span><span class="hs-comment">--              Pattern guards</span><span>
</span><span id="line-383"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier hs-type">tcGuardStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcExprStmtChecker"><span class="hs-identifier hs-type">TcExprStmtChecker</span></a></span><span>
</span><span id="line-386"></span><span id="tcGuardStmt"><span class="annot"><span class="annottext">tcGuardStmt :: TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier hs-var hs-var">tcGuardStmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123158"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123158"><span class="hs-identifier hs-var">guard</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123157"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123157"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681123156"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123156"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-387"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123155"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123155"><span class="hs-identifier hs-var">guard'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123158"><span class="hs-identifier hs-var">guard</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#boolTy"><span class="hs-identifier hs-var">boolTy</span></a></span><span>
</span><span id="line-388"></span><span>          </span><span class="hs-comment">-- Scale the guard to Many (see #19120 and #19193)</span><span>
</span><span id="line-389"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123153"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123153"><span class="hs-identifier hs-var">thing</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123156"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123157"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-390"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XBodyStmt idL idR body
-&gt; body -&gt; SyntaxExpr idR -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-var">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Builtin.Types.html#boolTy"><span class="hs-identifier hs-var">boolTy</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123155"><span class="hs-identifier hs-var">guard'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123153"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier hs-var">tcGuardStmt</span></a></span><span> </span><span id="local-6989586621681123151"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123151"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123149"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681123149"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681123148"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123148"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123147"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123147"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681123146"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123146"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-393"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- The Many on the next line and the unrestricted on the line after</span><span>
</span><span id="line-394"></span><span>          </span><span class="hs-comment">-- are linked. These must be the same multiplicity. Consider</span><span>
</span><span id="line-395"></span><span>          </span><span class="hs-comment">--   x &lt;- rhs -&gt; u</span><span>
</span><span id="line-396"></span><span>          </span><span class="hs-comment">--</span><span>
</span><span id="line-397"></span><span>          </span><span class="hs-comment">-- The multiplicity of x in u must be the same as the multiplicity at</span><span>
</span><span id="line-398"></span><span>          </span><span class="hs-comment">-- which the rhs has been consumed. When solving #18738, we want these</span><span>
</span><span id="line-399"></span><span>          </span><span class="hs-comment">-- two multiplicity to still be the same.</span><span>
</span><span id="line-400"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681123145"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123145"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123144"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123144"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc, Mult) -&gt; TcM (LHsExpr GhcTc, Mult)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc, Mult) -&gt; TcM (LHsExpr GhcTc, Mult))
-&gt; TcM (LHsExpr GhcTc, Mult) -&gt; TcM (LHsExpr GhcTc, Mult)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcM (LHsExpr GhcTc, Mult)
</span><a href="GHC.Tc.Gen.Expr.html#tcInferRhoNC"><span class="hs-identifier hs-var">tcInferRhoNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123148"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-401"></span><span>                                   </span><span class="hs-comment">-- Stmt has a context already</span><span>
</span><span id="line-402"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123143"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681123143"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123142"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123142"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; CtOrigin
-&gt; LPat GhcRn
-&gt; Scaled Mult
-&gt; TcM thing
-&gt; TcM (LPat GhcTc, thing)
forall a.
HsMatchContext GhcRn
-&gt; CtOrigin
-&gt; LPat GhcRn
-&gt; Scaled Mult
-&gt; TcM a
-&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat_O"><span class="hs-identifier hs-var">tcCheckPat_O</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123151"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#lexprCtOrigin"><span class="hs-identifier hs-var">lexprCtOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123148"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span>                                         </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681123149"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Scaled Mult
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123144"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM (LPat GhcTc, thing))
-&gt; TcM thing -&gt; TcM (LPat GhcTc, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-404"></span><span>                            </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123146"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123147"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-405"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcTc -&gt; LHsExpr GhcTc -&gt; Stmt GhcTc (LHsExpr GhcTc)
forall (bodyR :: * -&gt; *).
LPat GhcTc
-&gt; Located (bodyR GhcTc)
-&gt; StmtLR GhcTc GhcTc (Located (bodyR GhcTc))
</span><a href="GHC.Hs.Utils.html#mkTcBindStmt"><span class="hs-identifier hs-var">mkTcBindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681123143"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123145"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123142"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier hs-var">tcGuardStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123136"><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123136"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-408"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcGuardStmt: unexpected Stmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123136"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-409"></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-412"></span><span class="hs-comment">--           List comprehensions</span><span>
</span><span id="line-413"></span><span class="hs-comment">--               (no rebindable syntax)</span><span>
</span><span id="line-414"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span class="hs-comment">-- Dealt with separately, rather than by tcMcStmt, because</span><span>
</span><span id="line-417"></span><span class="hs-comment">--   a) We have special desugaring rules for list comprehensions,</span><span>
</span><span id="line-418"></span><span class="hs-comment">--      which avoid creating intermediate lists.  They in turn</span><span>
</span><span id="line-419"></span><span class="hs-comment">--      assume that the bind/return operations are the regular</span><span>
</span><span id="line-420"></span><span class="hs-comment">--      polymorphic ones, and in particular don't have any</span><span>
</span><span id="line-421"></span><span class="hs-comment">--      coercion matching stuff in them.  It's hard to avoid the</span><span>
</span><span id="line-422"></span><span class="hs-comment">--      potential for non-trivial coercions in tcMcStmt</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-type">tcLcStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span>       </span><span class="hs-comment">-- The list type constructor ([])</span><span>
</span><span id="line-425"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcExprStmtChecker"><span class="hs-identifier hs-type">TcExprStmtChecker</span></a></span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span id="tcLcStmt"><span class="annot"><span class="annottext">tcLcStmt :: TyCon -&gt; TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var hs-var">tcLcStmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span id="local-6989586621681123076"><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681123076"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681123075"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123075"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681123074"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681123074"><span class="hs-identifier hs-var">noret</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123073"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123073"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621681123072"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123072"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-428"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123071"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123071"><span class="hs-identifier hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcMonoExprNC"><span class="hs-identifier hs-var">tcMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123075"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123073"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-429"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123070"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123070"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123072"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ExpRhoType
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcLcStmt: thing_inside&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; Maybe Bool
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XLastStmt idL idR body
-&gt; body -&gt; Maybe Bool -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-var">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsExpr GhcRn)
XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681123076"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123071"><span class="hs-identifier hs-var">body'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681123074"><span class="hs-identifier hs-var">noret</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123070"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-431"></span><span>
</span><span id="line-432"></span><span class="hs-comment">-- A generator, pat &lt;- rhs</span><span>
</span><span id="line-433"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span id="local-6989586621681123068"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123068"><span class="hs-identifier hs-var">m_tc</span></a></span></span><span> </span><span id="local-6989586621681123067"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123067"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123066"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681123066"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681123065"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123065"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123064"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123064"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621681123063"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123063"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-434"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>   </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123062"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123062"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-435"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123059"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123059"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123065"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; [Mult] -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123068"><span class="hs-identifier hs-var">m_tc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123062"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-436"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123057"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681123057"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123056"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123056"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn
-&gt; Scaled Mult
-&gt; TcM thing
-&gt; TcM (LPat GhcTc, thing)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123067"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681123066"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Scaled Mult
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681123062"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM (LPat GhcTc, thing))
-&gt; TcM thing -&gt; TcM (LPat GhcTc, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-437"></span><span>                            </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123063"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123064"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-438"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcTc -&gt; LHsExpr GhcTc -&gt; Stmt GhcTc (LHsExpr GhcTc)
forall (bodyR :: * -&gt; *).
LPat GhcTc
-&gt; Located (bodyR GhcTc)
-&gt; StmtLR GhcTc GhcTc (Located (bodyR GhcTc))
</span><a href="GHC.Hs.Utils.html#mkTcBindStmt"><span class="hs-identifier hs-var">mkTcBindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681123057"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123059"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123056"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span class="hs-comment">-- A boolean guard</span><span>
</span><span id="line-441"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123054"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123054"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123053"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123053"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621681123052"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123052"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-442"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123051"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123051"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123054"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#boolTy"><span class="hs-identifier hs-var">boolTy</span></a></span><span>
</span><span id="line-443"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681123050"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123050"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123052"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123053"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-444"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XBodyStmt idL idR body
-&gt; body -&gt; SyntaxExpr idR -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-var">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Builtin.Types.html#boolTy"><span class="hs-identifier hs-var">boolTy</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681123051"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123050"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-445"></span><span>
</span><span id="line-446"></span><span class="hs-comment">-- ParStmt: See notes with tcMcStmt</span><span>
</span><span id="line-447"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span id="local-6989586621681123049"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123049"><span class="hs-identifier hs-var">m_tc</span></a></span></span><span> </span><span id="local-6989586621681123048"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123048"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681123046"><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681123046"><span class="hs-identifier hs-var">bndr_stmts_s</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123045"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123045"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621681123044"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123044"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-448"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123043"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681123043"><span class="hs-identifier hs-var">pairs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123042"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123042"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681123041"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681123046"><span class="hs-identifier hs-var">bndr_stmts_s</span></a></span><span>
</span><span id="line-449"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XParStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; [ParStmtBlock GhcTc GhcTc]
-&gt; HsExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XParStmt idL idR body
-&gt; [ParStmtBlock idL idR]
-&gt; HsExpr idR
-&gt; SyntaxExpr idR
-&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-var">ParStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XParStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681123043"><span class="hs-identifier hs-var">pairs'</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
forall (p :: Pass). HsExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noExpr"><span class="hs-identifier hs-var">noExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123042"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-450"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-451"></span><span>    </span><span class="hs-comment">-- loop :: [([LStmt GhcRn], [GhcRn])]</span><span>
</span><span id="line-452"></span><span>    </span><span class="hs-comment">--      -&gt; TcM ([([LStmt GhcTc], [GhcTc])], thing)</span><span>
</span><span id="line-453"></span><span>    </span><span id="local-6989586621681123041"><span class="annot"><span class="annottext">loop :: [ParStmtBlock GhcRn GhcRn]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681123041"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123038"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123038"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123044"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123045"><span class="hs-identifier hs-var">elt_ty</span></a></span><span>
</span><span id="line-454"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([ParStmtBlock GhcTc GhcTc], thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123038"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>         </span><span class="hs-comment">-- matching in the branches</span><span>
</span><span id="line-455"></span><span>
</span><span id="line-456"></span><span>    </span><span class="annot"><a href="#local-6989586621681123041"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span id="local-6989586621681123036"><span class="annot"><span class="annottext">XParStmtBlock GhcRn GhcRn
</span><a href="#local-6989586621681123036"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681123035"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123035"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681123034"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681123034"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681123033"><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681123033"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-457"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123032"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123032"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123031"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123031"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123030"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681123030"><span class="hs-identifier hs-var">pairs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123029"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123029"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-458"></span><span>                </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM ([Id], [ParStmtBlock GhcTc GhcTc], thing))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], [ParStmtBlock GhcTc GhcTc], thing))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123048"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123049"><span class="hs-identifier hs-var">m_tc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123035"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123045"><span class="hs-identifier hs-var">elt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM ([Id], [ParStmtBlock GhcTc GhcTc], thing))
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)],
       ([Id], [ParStmtBlock GhcTc GhcTc], thing)))
-&gt; (ExpRhoType -&gt; TcM ([Id], [ParStmtBlock GhcTc GhcTc], thing))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], [ParStmtBlock GhcTc GhcTc], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681123028"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123028"><span class="hs-identifier hs-var">_elt_ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-459"></span><span>                   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123027"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123027"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; TcM [Id]
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocalIds"><span class="hs-identifier hs-var">tcLookupLocalIds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681123034"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-460"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123025"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681123025"><span class="hs-identifier hs-var">pairs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123024"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123024"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681123041"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681123033"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-461"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id], [ParStmtBlock GhcTc GhcTc], thing)
-&gt; TcM ([Id], [ParStmtBlock GhcTc GhcTc], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123027"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681123025"><span class="hs-identifier hs-var">pairs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123024"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-462"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([ParStmtBlock GhcTc GhcTc], thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; [IdP GhcTc]
-&gt; SyntaxExpr GhcTc
-&gt; ParStmtBlock GhcTc GhcTc
forall idL idR.
XParStmtBlock idL idR
-&gt; [ExprLStmt idL]
-&gt; [IdP idR]
-&gt; SyntaxExpr idR
-&gt; ParStmtBlock idL idR
</span><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-var">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcRn GhcRn
XParStmtBlock GhcTc GhcTc
</span><a href="#local-6989586621681123036"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123032"><span class="hs-identifier hs-var">stmts'</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681123031"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">ParStmtBlock GhcTc GhcTc
-&gt; [ParStmtBlock GhcTc GhcTc] -&gt; [ParStmtBlock GhcTc GhcTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681123030"><span class="hs-identifier hs-var">pairs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681123029"><span class="hs-identifier hs-var">thing</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-463"></span><span>
</span><span id="line-464"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span id="local-6989586621681123023"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123023"><span class="hs-identifier hs-var">m_tc</span></a></span></span><span> </span><span id="local-6989586621681123022"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123022"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">trS_form :: forall idL idR body. StmtLR idL idR body -&gt; TransForm
</span><a href="GHC.Hs.Expr.html#trS_form"><span class="hs-identifier hs-var">trS_form</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123019"><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681123019"><span class="hs-identifier hs-var">form</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [ExprLStmt idL]
</span><a href="GHC.Hs.Expr.html#trS_stmts"><span class="hs-identifier hs-var">trS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123017"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123017"><span class="hs-identifier hs-var">stmts</span></a></span></span><span>
</span><span id="line-465"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bndrs :: forall idL idR body. StmtLR idL idR body -&gt; [(IdP idR, IdP idR)]
</span><a href="GHC.Hs.Expr.html#trS_bndrs"><span class="hs-identifier hs-var">trS_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span id="local-6989586621681123015"><span class="annot"><span class="annottext">[(IdP GhcRn, IdP GhcRn)]
</span><a href="#local-6989586621681123015"><span class="hs-identifier hs-var">bindersMap</span></a></span></span><span>
</span><span id="line-466"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_by :: forall idL idR body. StmtLR idL idR body -&gt; Maybe (LHsExpr idR)
</span><a href="GHC.Hs.Expr.html#trS_by"><span class="hs-identifier hs-var">trS_by</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123013"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="#local-6989586621681123013"><span class="hs-identifier hs-var">by</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_using :: forall idL idR body. StmtLR idL idR body -&gt; LHsExpr idR
</span><a href="GHC.Hs.Expr.html#trS_using"><span class="hs-identifier hs-var">trS_using</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681123011"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123011"><span class="hs-identifier hs-var">using</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681123010"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123010"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span> </span><span id="local-6989586621681123009"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123009"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-467"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123008"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681123008"><span class="hs-identifier hs-var">bndr_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123007"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681123007"><span class="hs-identifier hs-var">n_bndr_names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Name)] -&gt; ([Name], [Name])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Name)]
[(IdP GhcRn, IdP GhcRn)]
</span><a href="#local-6989586621681123015"><span class="hs-identifier hs-var">bindersMap</span></a></span><span>
</span><span id="line-468"></span><span>             </span><span id="local-6989586621681123006"><span class="annot"><span class="annottext">unused_ty :: ExpRhoType
</span><a href="#local-6989586621681123006"><span class="hs-identifier hs-var hs-var">unused_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ExpRhoType
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcLcStmt: inner ty&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Name, Name)] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Name)]
[(IdP GhcRn, IdP GhcRn)]
</span><a href="#local-6989586621681123015"><span class="hs-identifier hs-var">bindersMap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span>             </span><span class="hs-comment">-- The inner 'stmts' lack a LastStmt, so the element type</span><span>
</span><span id="line-470"></span><span>             </span><span class="hs-comment">--  passed in to tcStmtsAndThen is never looked at</span><span>
</span><span id="line-471"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123005"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123005"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681123004"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123004"><span class="hs-identifier hs-var">bndr_ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681123003"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc, Mult)
</span><a href="#local-6989586621681123003"><span class="hs-identifier hs-var">by'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-472"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM ([Id], Maybe (LHsExpr GhcTc, Mult)))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], Maybe (LHsExpr GhcTc, Mult)))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsStmtContext GhcRn
forall p. HsStmtContext p -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#TransStmtCtxt"><span class="hs-identifier hs-var">TransStmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681123022"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123023"><span class="hs-identifier hs-var">m_tc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681123017"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123006"><span class="hs-identifier hs-var">unused_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM ([Id], Maybe (LHsExpr GhcTc, Mult)))
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)],
       ([Id], Maybe (LHsExpr GhcTc, Mult))))
-&gt; (ExpRhoType -&gt; TcM ([Id], Maybe (LHsExpr GhcTc, Mult)))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], Maybe (LHsExpr GhcTc, Mult)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-473"></span><span>               </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681123001"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc, Mult)
</span><a href="#local-6989586621681123001"><span class="hs-identifier hs-var">by'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcRn -&gt; TcM (LHsExpr GhcTc, Mult))
-&gt; Maybe (LHsExpr GhcRn)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (LHsExpr GhcTc, Mult))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcM (LHsExpr GhcTc, Mult)
</span><a href="GHC.Tc.Gen.Expr.html#tcInferRho"><span class="hs-identifier hs-var">tcInferRho</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="#local-6989586621681123013"><span class="hs-identifier hs-var">by</span></a></span><span>
</span><span id="line-474"></span><span>               </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122999"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122999"><span class="hs-identifier hs-var">bndr_ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; TcM [Id]
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocalIds"><span class="hs-identifier hs-var">tcLookupLocalIds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681123008"><span class="hs-identifier hs-var">bndr_names</span></a></span><span>
</span><span id="line-475"></span><span>               </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id], Maybe (LHsExpr GhcTc, Mult))
-&gt; TcM ([Id], Maybe (LHsExpr GhcTc, Mult))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122999"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc, Mult)
</span><a href="#local-6989586621681123001"><span class="hs-identifier hs-var">by'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-476"></span><span>
</span><span id="line-477"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122998"><span class="annot"><span class="annottext">m_app :: Mult -&gt; Mult
</span><a href="#local-6989586621681122998"><span class="hs-identifier hs-var hs-var">m_app</span></a></span></span><span> </span><span id="local-6989586621681122997"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122997"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Mult] -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681123023"><span class="hs-identifier hs-var">m_tc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122997"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-478"></span><span>
</span><span id="line-479"></span><span>       </span><span class="hs-comment">--------------- Typecheck the 'using' function -------------</span><span>
</span><span id="line-480"></span><span>       </span><span class="hs-comment">-- using :: ((a,b,c)-&gt;t) -&gt; m (a,b,c) -&gt; m (a,b,c)m      (ThenForm)</span><span>
</span><span id="line-481"></span><span>       </span><span class="hs-comment">--       :: ((a,b,c)-&gt;t) -&gt; m (a,b,c) -&gt; m (m (a,b,c)))  (GroupForm)</span><span>
</span><span id="line-482"></span><span>
</span><span id="line-483"></span><span>         </span><span class="hs-comment">-- n_app :: Type -&gt; Type   -- Wraps a 'ty' into '[ty]' for GroupForm</span><span>
</span><span id="line-484"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122996"><span class="annot"><span class="annottext">n_app :: Mult -&gt; Mult
</span><a href="#local-6989586621681122996"><span class="hs-identifier hs-var hs-var">n_app</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681123019"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-485"></span><span>                       </span><span class="annot"><span class="annottext">TransForm
</span><a href="GHC.Hs.Expr.html#ThenForm"><span class="hs-identifier hs-var">ThenForm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681122994"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122994"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122994"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-486"></span><span>                       </span><span class="annot"><span class="annottext">TransForm
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122998"><span class="hs-identifier hs-var">m_app</span></a></span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span>             </span><span class="annot"><a href="#local-6989586621681122993"><span class="hs-identifier hs-type">by_arrow</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>     </span><span class="hs-comment">-- Wraps 'ty' to '(a-&gt;t) -&gt; ty' if the By is present</span><span>
</span><span id="line-489"></span><span>             </span><span id="local-6989586621681122993"><span class="annot"><span class="annottext">by_arrow :: Mult -&gt; Mult
</span><a href="#local-6989586621681122993"><span class="hs-identifier hs-var hs-var">by_arrow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc, Mult)
</span><a href="#local-6989586621681123003"><span class="hs-identifier hs-var">by'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-490"></span><span>                          </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc, Mult)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122991"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122991"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122991"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-491"></span><span>                          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681122990"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122990"><span class="hs-identifier hs-var">e_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122989"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122989"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122990"><span class="hs-identifier hs-var">e_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122989"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-492"></span><span>
</span><span id="line-493"></span><span>             </span><span id="local-6989586621681122986"><span class="annot"><span class="annottext">tup_ty :: Mult
</span><a href="#local-6989586621681122986"><span class="hs-identifier hs-var hs-var">tup_ty</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Mult
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123004"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span>
</span><span id="line-494"></span><span>             </span><span id="local-6989586621681122984"><span class="annot"><span class="annottext">poly_arg_ty :: Mult
</span><a href="#local-6989586621681122984"><span class="hs-identifier hs-var hs-var">poly_arg_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122998"><span class="hs-identifier hs-var">m_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span>
</span><span id="line-495"></span><span>             </span><span id="local-6989586621681122983"><span class="annot"><span class="annottext">poly_res_ty :: Mult
</span><a href="#local-6989586621681122983"><span class="hs-identifier hs-var hs-var">poly_res_ty</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122998"><span class="hs-identifier hs-var">m_app</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122996"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-496"></span><span>             </span><span id="local-6989586621681122982"><span class="annot"><span class="annottext">using_poly_ty :: Mult
</span><a href="#local-6989586621681122982"><span class="hs-identifier hs-var hs-var">using_poly_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkInfForAllTy"><span class="hs-identifier hs-var">mkInfForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-497"></span><span>                             </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122993"><span class="hs-identifier hs-var">by_arrow</span></a></span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-498"></span><span>                             </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122984"><span class="hs-identifier hs-var">poly_arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122983"><span class="hs-identifier hs-var">poly_res_ty</span></a></span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122979"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122979"><span class="hs-identifier hs-var">using'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier hs-var">tcCheckPolyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681123011"><span class="hs-identifier hs-var">using</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122982"><span class="hs-identifier hs-var">using_poly_ty</span></a></span><span>
</span><span id="line-501"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122978"><span class="annot"><span class="annottext">final_using :: LHsExpr GhcTc
</span><a href="#local-6989586621681122978"><span class="hs-identifier hs-var hs-var">final_using</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc -&gt; HsExpr GhcTc) -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; HsExpr GhcTc -&gt; HsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsWrap"><span class="hs-identifier hs-var">mkHsWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#WpTyApp"><span class="hs-identifier hs-var">WpTyApp</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122986"><span class="hs-identifier hs-var">tup_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122979"><span class="hs-identifier hs-var">using'</span></a></span><span>
</span><span id="line-502"></span><span>
</span><span id="line-503"></span><span>             </span><span class="hs-comment">-- 'stmts' returns a result of type (m1_ty tuple_ty),</span><span>
</span><span id="line-504"></span><span>             </span><span class="hs-comment">-- typically something like [(Int,Bool,Int)]</span><span>
</span><span id="line-505"></span><span>             </span><span class="hs-comment">-- We don't know what tuple_ty is yet, so we use a variable</span><span>
</span><span id="line-506"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681122975"><span class="hs-identifier hs-type">mk_n_bndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span>
</span><span id="line-507"></span><span>             </span><span id="local-6989586621681122975"><span class="annot"><span class="annottext">mk_n_bndr :: Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681122975"><span class="hs-identifier hs-var hs-var">mk_n_bndr</span></a></span></span><span> </span><span id="local-6989586621681122973"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122973"><span class="hs-identifier hs-var">n_bndr_name</span></a></span></span><span> </span><span id="local-6989586621681122972"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681122972"><span class="hs-identifier hs-var">bndr_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Mult -&gt; Mult -&gt; Id
Name -&gt; Mult -&gt; Mult -&gt; Id
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122973"><span class="hs-identifier hs-var">n_bndr_name</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122996"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Mult
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681122972"><span class="hs-identifier hs-var">bndr_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-508"></span><span>
</span><span id="line-509"></span><span>             </span><span class="hs-comment">-- Ensure that every old binder of type `b` is linked up with its</span><span>
</span><span id="line-510"></span><span>             </span><span class="hs-comment">-- new binder which should have type `n b`</span><span>
</span><span id="line-511"></span><span>             </span><span class="hs-comment">-- See Note [GroupStmt binder map] in GHC.Hs.Expr</span><span>
</span><span id="line-512"></span><span>             </span><span id="local-6989586621681122969"><span class="annot"><span class="annottext">n_bndr_ids :: [Id]
</span><a href="#local-6989586621681122969"><span class="hs-identifier hs-var hs-var">n_bndr_ids</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Id -&gt; Id) -&gt; [Name] -&gt; [Id] -&gt; [Id]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681122975"><span class="hs-identifier hs-var">mk_n_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681123007"><span class="hs-identifier hs-var">n_bndr_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123004"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span>
</span><span id="line-513"></span><span>             </span><span id="local-6989586621681122967"><span class="annot"><span class="annottext">bindersMap' :: [(Id, Id)]
</span><a href="#local-6989586621681122967"><span class="hs-identifier hs-var hs-var">bindersMap'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681123004"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [(Id, Id)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122969"><span class="hs-identifier hs-var">n_bndr_ids</span></a></span><span>
</span><span id="line-514"></span><span>
</span><span id="line-515"></span><span>       </span><span class="hs-comment">-- Type check the thing in the environment with</span><span>
</span><span id="line-516"></span><span>       </span><span class="hs-comment">-- these new binders and return the result</span><span>
</span><span id="line-517"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122966"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122966"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; TcM thing -&gt; TcM thing
forall a. [Id] -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Env.html#tcExtendIdEnv"><span class="hs-identifier hs-var">tcExtendIdEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122969"><span class="hs-identifier hs-var">n_bndr_ids</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681123009"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681123010"><span class="hs-identifier hs-var">elt_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-518"></span><span>
</span><span id="line-519"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TransStmt :: forall idL idR body.
XTransStmt idL idR body
-&gt; TransForm
-&gt; [ExprLStmt idL]
-&gt; [(IdP idR, IdP idR)]
-&gt; LHsExpr idR
-&gt; Maybe (LHsExpr idR)
-&gt; SyntaxExpr idR
-&gt; SyntaxExpr idR
-&gt; HsExpr idR
-&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">trS_stmts :: [LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="GHC.Hs.Expr.html#trS_stmts"><span class="hs-identifier hs-var">trS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681123005"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bndrs :: [(IdP GhcTc, IdP GhcTc)]
</span><a href="GHC.Hs.Expr.html#trS_bndrs"><span class="hs-identifier hs-var">trS_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Id)]
[(IdP GhcTc, IdP GhcTc)]
</span><a href="#local-6989586621681122967"><span class="hs-identifier hs-var">bindersMap'</span></a></span><span>
</span><span id="line-520"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_by :: Maybe (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#trS_by"><span class="hs-identifier hs-var">trS_by</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((LHsExpr GhcTc, Mult) -&gt; LHsExpr GhcTc)
-&gt; Maybe (LHsExpr GhcTc, Mult) -&gt; Maybe (LHsExpr GhcTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc, Mult) -&gt; LHsExpr GhcTc
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc, Mult)
</span><a href="#local-6989586621681123003"><span class="hs-identifier hs-var">by'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_using :: LHsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_using"><span class="hs-identifier hs-var">trS_using</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122978"><span class="hs-identifier hs-var">final_using</span></a></span><span>
</span><span id="line-521"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ret :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_ret"><span class="hs-identifier hs-var">trS_ret</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span>
</span><span id="line-522"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bind :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_bind"><span class="hs-identifier hs-var">trS_bind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span>
</span><span id="line-523"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_fmap :: HsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_fmap"><span class="hs-identifier hs-var">trS_fmap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
forall (p :: Pass). HsExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noExpr"><span class="hs-identifier hs-var">noExpr</span></a></span><span>
</span><span id="line-524"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ext :: XTransStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#trS_ext"><span class="hs-identifier hs-var">trS_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
XTransStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span>
</span><span id="line-525"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_form :: TransForm
</span><a href="GHC.Hs.Expr.html#trS_form"><span class="hs-identifier hs-var">trS_form</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681123019"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122966"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-526"></span><span>
</span><span id="line-527"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcLcStmt"><span class="hs-identifier hs-var">tcLcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122960"><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122960"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcLcStmt: unexpected Stmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122960"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-529"></span><span>
</span><span id="line-530"></span><span>
</span><span id="line-531"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-532"></span><span class="hs-comment">--           Monad comprehensions</span><span>
</span><span id="line-533"></span><span class="hs-comment">--        (supports rebindable syntax)</span><span>
</span><span id="line-534"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-type">tcMcStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcExprStmtChecker"><span class="hs-identifier hs-type">TcExprStmtChecker</span></a></span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span id="tcMcStmt"><span class="annot"><span class="annottext">tcMcStmt :: TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var hs-var">tcMcStmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span id="local-6989586621681122881"><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122881"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681122880"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122880"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681122879"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681122879"><span class="hs-identifier hs-var">noret</span></a></span></span><span> </span><span id="local-6989586621681122878"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122878"><span class="hs-identifier hs-var">return_op</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122877"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122877"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122876"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122876"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-539"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122875"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122875"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122874"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122874"><span class="hs-identifier hs-var">return_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-540"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122878"><span class="hs-identifier hs-var">return_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122877"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc))
 -&gt; TcM (LHsExpr GhcTc, SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-541"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122871"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122871"><span class="hs-identifier hs-var">a_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122870"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122870"><span class="hs-identifier hs-var">mult</span></a></span></span><span class="hs-special">]</span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-542"></span><span>               </span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122870"><span class="hs-identifier hs-var">mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExprNC"><span class="hs-identifier hs-var">tcCheckMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122880"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122871"><span class="hs-identifier hs-var">a_ty</span></a></span><span>
</span><span id="line-543"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122869"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122869"><span class="hs-identifier hs-var">thing</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122876"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ExpRhoType
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcMcStmt: thing_inside&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-544"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; Maybe Bool
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XLastStmt idL idR body
-&gt; body -&gt; Maybe Bool -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-var">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsExpr GhcRn)
XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681122881"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122875"><span class="hs-identifier hs-var">body'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681122879"><span class="hs-identifier hs-var">noret</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122874"><span class="hs-identifier hs-var">return_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122869"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-545"></span><span>
</span><span id="line-546"></span><span class="hs-comment">-- Generators for monad comprehensions ( pat &lt;- rhs )</span><span>
</span><span id="line-547"></span><span class="hs-comment">--</span><span>
</span><span id="line-548"></span><span class="hs-comment">--   [ body | q &lt;- gen ]  -&gt;  gen :: m a</span><span>
</span><span id="line-549"></span><span class="hs-comment">--                            q   ::   a</span><span>
</span><span id="line-550"></span><span class="hs-comment">--</span><span>
</span><span id="line-551"></span><span>
</span><span id="line-552"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span id="local-6989586621681122868"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122868"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span id="local-6989586621681122867"><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122867"><span class="hs-identifier hs-var">xbsrn</span></a></span></span><span> </span><span id="local-6989586621681122866"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122866"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681122865"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122865"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122864"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122864"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122863"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122863"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-553"></span><span>           </span><span class="hs-comment">-- (&gt;&gt;=) :: rhs_ty -&gt; (pat_ty -&gt; new_res_ty) -&gt; res_ty</span><span>
</span><span id="line-554"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122862"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122862"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122861"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122861"><span class="hs-identifier hs-var">pat_mult</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122860"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122860"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122859"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122859"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122858"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122858"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122857"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122857"><span class="hs-identifier hs-var">bind_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-555"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult]
    -&gt; [Mult]
    -&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult))
-&gt; TcM
     ((LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult),
      SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtRn -&gt; SyntaxExpr GhcRn
</span><a href="GHC.Hs.Expr.html#xbsrn_bindOp"><span class="hs-identifier hs-var hs-var">xbsrn_bindOp</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
XBindStmtRn
</span><a href="#local-6989586621681122867"><span class="hs-identifier hs-var">xbsrn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-556"></span><span>                          </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType -&gt; SyntaxOpType -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynFun"><span class="hs-identifier hs-var">SynFun</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynAny"><span class="hs-identifier hs-var">SynAny</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122864"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult]
  -&gt; [Mult]
  -&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult))
 -&gt; TcM
      ((LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult),
       SyntaxExprTc))
-&gt; ([Mult]
    -&gt; [Mult]
    -&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult))
-&gt; TcM
     ((LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult),
      SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-557"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122853"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122853"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122852"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122852"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122851"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122851"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122850"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122850"><span class="hs-identifier hs-var">rhs_mult</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122849"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122849"><span class="hs-identifier hs-var">fun_mult</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122848"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122848"><span class="hs-identifier hs-var">pat_mult</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-558"></span><span>               </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122847"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122847"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122850"><span class="hs-identifier hs-var">rhs_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExprNC"><span class="hs-identifier hs-var">tcCheckMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122865"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122853"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-559"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122846"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122846"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122845"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122845"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; TcM (Located (Pat GhcTc), thing)
-&gt; TcM (Located (Pat GhcTc), thing)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122849"><span class="hs-identifier hs-var">fun_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Located (Pat GhcTc), thing)
 -&gt; TcM (Located (Pat GhcTc), thing))
-&gt; TcM (Located (Pat GhcTc), thing)
-&gt; TcM (Located (Pat GhcTc), thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn
-&gt; Scaled Mult
-&gt; TcM thing
-&gt; TcM (LPat GhcTc, thing)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122868"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122866"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Scaled Mult
forall a. Mult -&gt; a -&gt; Scaled a
</span><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-var">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122848"><span class="hs-identifier hs-var">pat_mult</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122852"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM (LPat GhcTc, thing))
-&gt; TcM thing -&gt; TcM (LPat GhcTc, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-560"></span><span>                                     </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122863"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122851"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-561"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult)
-&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), thing, Mult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122847"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122848"><span class="hs-identifier hs-var">pat_mult</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122846"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122845"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122851"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-562"></span><span>
</span><span id="line-563"></span><span>        </span><span class="hs-comment">-- If (but only if) the pattern can fail, typecheck the 'fail' operator</span><span>
</span><span id="line-564"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122844"><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="#local-6989586621681122844"><span class="hs-identifier hs-var">fail_op'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Maybe (Maybe SyntaxExprTc) -&gt; Maybe SyntaxExprTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe SyntaxExprTc) -&gt; Maybe SyntaxExprTc
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; ((SyntaxExprRn
     -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc)))
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprRn
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtRn -&gt; FailOperator GhcRn
</span><a href="GHC.Hs.Expr.html#xbsrn_failOp"><span class="hs-identifier hs-var hs-var">xbsrn_failOp</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
XBindStmtRn
</span><a href="#local-6989586621681122867"><span class="hs-identifier hs-var">xbsrn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((SyntaxExprRn
  -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122841"><span class="annot"><span class="annottext">SyntaxExprRn
</span><a href="#local-6989586621681122841"><span class="hs-identifier hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-565"></span><span>            </span><span class="annot"><span class="annottext">CtOrigin
-&gt; LPat GhcTc
-&gt; SyntaxExpr GhcRn
-&gt; Mult
-&gt; TcRn (FailOperator GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcMonadFailOp"><span class="hs-identifier hs-var">tcMonadFailOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcRn -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompPatOrigin"><span class="hs-identifier hs-var">MCompPatOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122866"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122860"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122841"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122858"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122838"><span class="annot"><span class="annottext">xbstc :: XBindStmtTc
</span><a href="#local-6989586621681122838"><span class="hs-identifier hs-var hs-var">xbstc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XBindStmtTc :: SyntaxExpr GhcTc
-&gt; Mult -&gt; Mult -&gt; FailOperator GhcTc -&gt; XBindStmtTc
</span><a href="GHC.Hs.Expr.html#XBindStmtTc"><span class="hs-identifier hs-type">XBindStmtTc</span></a></span><span>
</span><span id="line-568"></span><span>                </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">xbstc_bindOp :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#xbstc_bindOp"><span class="hs-identifier hs-var">xbstc_bindOp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122857"><span class="hs-identifier hs-var">bind_op'</span></a></span><span>
</span><span id="line-569"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">xbstc_boundResultType :: Mult
</span><a href="GHC.Hs.Expr.html#xbstc_boundResultType"><span class="hs-identifier hs-var">xbstc_boundResultType</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122858"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span>
</span><span id="line-570"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">xbstc_boundResultMult :: Mult
</span><a href="GHC.Hs.Expr.html#xbstc_boundResultMult"><span class="hs-identifier hs-var">xbstc_boundResultMult</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122861"><span class="hs-identifier hs-var">pat_mult</span></a></span><span>
</span><span id="line-571"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">xbstc_failOp :: FailOperator GhcTc
</span><a href="GHC.Hs.Expr.html#xbstc_failOp"><span class="hs-identifier hs-var">xbstc_failOp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FailOperator GhcTc
Maybe SyntaxExprTc
</span><a href="#local-6989586621681122844"><span class="hs-identifier hs-var">fail_op'</span></a></span><span>
</span><span id="line-572"></span><span>                </span><span class="hs-special">}</span><span>
</span><span id="line-573"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LPat GhcTc -&gt; LHsExpr GhcTc -&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XBindStmt idL idR body -&gt; LPat idL -&gt; body -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-var">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
XBindStmtTc
</span><a href="#local-6989586621681122838"><span class="hs-identifier hs-var">xbstc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122860"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122862"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122859"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-574"></span><span>
</span><span id="line-575"></span><span class="hs-comment">-- Boolean expressions.</span><span>
</span><span id="line-576"></span><span class="hs-comment">--</span><span>
</span><span id="line-577"></span><span class="hs-comment">--   [ body | stmts, expr ]  -&gt;  expr :: m Bool</span><span>
</span><span id="line-578"></span><span class="hs-comment">--</span><span>
</span><span id="line-579"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122832"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122832"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681122831"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122831"><span class="hs-identifier hs-var">then_op</span></a></span></span><span> </span><span id="local-6989586621681122830"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122830"><span class="hs-identifier hs-var">guard_op</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122829"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122829"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122828"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122828"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-580"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Deal with rebindable syntax:</span><span>
</span><span id="line-581"></span><span>          </span><span class="hs-comment">--    guard_op :: test_ty -&gt; rhs_ty</span><span>
</span><span id="line-582"></span><span>          </span><span class="hs-comment">--    then_op  :: rhs_ty -&gt; new_res_ty -&gt; res_ty</span><span>
</span><span id="line-583"></span><span>          </span><span class="hs-comment">-- Where test_ty is, for example, Bool</span><span>
</span><span id="line-584"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122827"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122827"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122826"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122826"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122825"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122825"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122824"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122824"><span class="hs-identifier hs-var">guard_op'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122823"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122823"><span class="hs-identifier hs-var">then_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-585"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult]
    -&gt; [Mult] -&gt; TcM (thing, LHsExpr GhcTc, Mult, SyntaxExprTc))
-&gt; TcM ((thing, LHsExpr GhcTc, Mult, SyntaxExprTc), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122831"><span class="hs-identifier hs-var">then_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122829"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult]
  -&gt; [Mult] -&gt; TcM (thing, LHsExpr GhcTc, Mult, SyntaxExprTc))
 -&gt; TcM ((thing, LHsExpr GhcTc, Mult, SyntaxExprTc), SyntaxExprTc))
-&gt; ([Mult]
    -&gt; [Mult] -&gt; TcM (thing, LHsExpr GhcTc, Mult, SyntaxExprTc))
-&gt; TcM ((thing, LHsExpr GhcTc, Mult, SyntaxExprTc), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-586"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122822"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122822"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122821"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122821"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122820"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122820"><span class="hs-identifier hs-var">rhs_mult</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122819"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122819"><span class="hs-identifier hs-var">fun_mult</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-587"></span><span>               </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122818"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122818"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122817"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122817"><span class="hs-identifier hs-var">guard_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-588"></span><span>                      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122820"><span class="hs-identifier hs-var">rhs_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc, SyntaxExprTc)
 -&gt; TcM (LHsExpr GhcTc, SyntaxExprTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-589"></span><span>                         </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122830"><span class="hs-identifier hs-var">guard_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynAny"><span class="hs-identifier hs-var">SynAny</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-590"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122822"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc))
 -&gt; TcM (LHsExpr GhcTc, SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-591"></span><span>                         </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122816"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122816"><span class="hs-identifier hs-var">test_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122815"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122815"><span class="hs-identifier hs-var">test_mult</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-592"></span><span>                         </span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122815"><span class="hs-identifier hs-var">test_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122832"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122816"><span class="hs-identifier hs-var">test_ty</span></a></span><span>
</span><span id="line-593"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122814"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122814"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM thing -&gt; TcM thing
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122819"><span class="hs-identifier hs-var">fun_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM thing) -&gt; TcM thing -&gt; TcM thing
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122828"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122821"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-594"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(thing, LHsExpr GhcTc, Mult, SyntaxExprTc)
-&gt; TcM (thing, LHsExpr GhcTc, Mult, SyntaxExprTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122814"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122818"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122822"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122817"><span class="hs-identifier hs-var">guard_op'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-595"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XBodyStmt idL idR body
-&gt; body -&gt; SyntaxExpr idR -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-var">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681122825"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122826"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122823"><span class="hs-identifier hs-var">then_op'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122824"><span class="hs-identifier hs-var">guard_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122827"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span class="hs-comment">-- Grouping statements</span><span>
</span><span id="line-598"></span><span class="hs-comment">--</span><span>
</span><span id="line-599"></span><span class="hs-comment">--   [ body | stmts, then group by e using f ]</span><span>
</span><span id="line-600"></span><span class="hs-comment">--     -&gt;  e :: t</span><span>
</span><span id="line-601"></span><span class="hs-comment">--         f :: forall a. (a -&gt; t) -&gt; m a -&gt; m (m a)</span><span>
</span><span id="line-602"></span><span class="hs-comment">--   [ body | stmts, then group using f ]</span><span>
</span><span id="line-603"></span><span class="hs-comment">--     -&gt;  f :: forall a. m a -&gt; m (m a)</span><span>
</span><span id="line-604"></span><span>
</span><span id="line-605"></span><span class="hs-comment">-- We type [ body | (stmts, group by e using f), ... ]</span><span>
</span><span id="line-606"></span><span class="hs-comment">--     f &lt;optional by&gt; [ (a,b,c) | stmts ] &gt;&gt;= \(a,b,c) -&gt; ...body....</span><span>
</span><span id="line-607"></span><span class="hs-comment">--</span><span>
</span><span id="line-608"></span><span class="hs-comment">-- We type the functions as follows:</span><span>
</span><span id="line-609"></span><span class="hs-comment">--     f &lt;optional by&gt; :: m1 (a,b,c) -&gt; m2 (a,b,c)              (ThenForm)</span><span>
</span><span id="line-610"></span><span class="hs-comment">--                     :: m1 (a,b,c) -&gt; m2 (n (a,b,c))          (GroupForm)</span><span>
</span><span id="line-611"></span><span class="hs-comment">--     (&gt;&gt;=) :: m2 (a,b,c)     -&gt; ((a,b,c)   -&gt; res) -&gt; res     (ThenForm)</span><span>
</span><span id="line-612"></span><span class="hs-comment">--           :: m2 (n (a,b,c)) -&gt; (n (a,b,c) -&gt; res) -&gt; res     (GroupForm)</span><span>
</span><span id="line-613"></span><span class="hs-comment">--</span><span>
</span><span id="line-614"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span id="local-6989586621681122813"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122813"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">trS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [ExprLStmt idL]
</span><a href="GHC.Hs.Expr.html#trS_stmts"><span class="hs-identifier hs-var">trS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122812"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122812"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bndrs :: forall idL idR body. StmtLR idL idR body -&gt; [(IdP idR, IdP idR)]
</span><a href="GHC.Hs.Expr.html#trS_bndrs"><span class="hs-identifier hs-var">trS_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122811"><span class="annot"><span class="annottext">[(IdP GhcRn, IdP GhcRn)]
</span><a href="#local-6989586621681122811"><span class="hs-identifier hs-var">bindersMap</span></a></span></span><span>
</span><span id="line-615"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_by :: forall idL idR body. StmtLR idL idR body -&gt; Maybe (LHsExpr idR)
</span><a href="GHC.Hs.Expr.html#trS_by"><span class="hs-identifier hs-var">trS_by</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122810"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="#local-6989586621681122810"><span class="hs-identifier hs-var">by</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_using :: forall idL idR body. StmtLR idL idR body -&gt; LHsExpr idR
</span><a href="GHC.Hs.Expr.html#trS_using"><span class="hs-identifier hs-var">trS_using</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122809"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122809"><span class="hs-identifier hs-var">using</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_form :: forall idL idR body. StmtLR idL idR body -&gt; TransForm
</span><a href="GHC.Hs.Expr.html#trS_form"><span class="hs-identifier hs-var">trS_form</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122808"><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681122808"><span class="hs-identifier hs-var">form</span></a></span></span><span>
</span><span id="line-616"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ret :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#trS_ret"><span class="hs-identifier hs-var">trS_ret</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122807"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122807"><span class="hs-identifier hs-var">return_op</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bind :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#trS_bind"><span class="hs-identifier hs-var">trS_bind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122806"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122806"><span class="hs-identifier hs-var">bind_op</span></a></span></span><span>
</span><span id="line-617"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_fmap :: forall idL idR body. StmtLR idL idR body -&gt; HsExpr idR
</span><a href="GHC.Hs.Expr.html#trS_fmap"><span class="hs-identifier hs-var">trS_fmap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122805"><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681122805"><span class="hs-identifier hs-var">fmap_op</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122804"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122804"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122803"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122803"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-618"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122802"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122802"><span class="hs-identifier hs-var">m1_ty</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#typeToTypeKind"><span class="hs-identifier hs-var">typeToTypeKind</span></a></span><span>
</span><span id="line-619"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122800"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122800"><span class="hs-identifier hs-var">m2_ty</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#typeToTypeKind"><span class="hs-identifier hs-var">typeToTypeKind</span></a></span><span>
</span><span id="line-620"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122799"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122799"><span class="hs-identifier hs-var">tup_ty</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-621"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122798"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122798"><span class="hs-identifier hs-var">by_e_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>  </span><span class="hs-comment">-- The type of the 'by' expression (if any)</span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span>         </span><span class="hs-comment">-- n_app :: Type -&gt; Type   -- Wraps a 'ty' into '(n ty)' for GroupForm</span><span>
</span><span id="line-624"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122797"><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681122808"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-625"></span><span>                    </span><span class="annot"><span class="annottext">TransForm
</span><a href="GHC.Hs.Expr.html#ThenForm"><span class="hs-identifier hs-var">ThenForm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Mult -&gt; Mult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681122796"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122796"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122796"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>                    </span><span class="annot"><span class="annottext">TransForm
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122795"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122795"><span class="hs-identifier hs-var">n_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#typeToTypeKind"><span class="hs-identifier hs-var">typeToTypeKind</span></a></span><span>
</span><span id="line-627"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Mult -&gt; Mult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122795"><span class="hs-identifier hs-var">n_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-628"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681122793"><span class="hs-identifier hs-type">by_arrow</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-629"></span><span>             </span><span class="hs-comment">-- (by_arrow res) produces ((alpha-&gt;e_ty) -&gt; res)     ('by' present)</span><span>
</span><span id="line-630"></span><span>             </span><span class="hs-comment">--                          or res                    ('by' absent)</span><span>
</span><span id="line-631"></span><span>             </span><span id="local-6989586621681122793"><span class="annot"><span class="annottext">by_arrow :: Mult -&gt; Mult
</span><a href="#local-6989586621681122793"><span class="hs-identifier hs-var hs-var">by_arrow</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="#local-6989586621681122810"><span class="hs-identifier hs-var">by</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-632"></span><span>                          </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122792"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122792"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122792"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-633"></span><span>                          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122791"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122791"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122798"><span class="hs-identifier hs-var">by_e_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122791"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-634"></span><span>
</span><span id="line-635"></span><span>             </span><span id="local-6989586621681122790"><span class="annot"><span class="annottext">poly_arg_ty :: Mult
</span><a href="#local-6989586621681122790"><span class="hs-identifier hs-var hs-var">poly_arg_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122802"><span class="hs-identifier hs-var">m1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span>
</span><span id="line-636"></span><span>             </span><span id="local-6989586621681122789"><span class="annot"><span class="annottext">using_arg_ty :: Mult
</span><a href="#local-6989586621681122789"><span class="hs-identifier hs-var hs-var">using_arg_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122802"><span class="hs-identifier hs-var">m1_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122799"><span class="hs-identifier hs-var">tup_ty</span></a></span><span>
</span><span id="line-637"></span><span>             </span><span id="local-6989586621681122788"><span class="annot"><span class="annottext">poly_res_ty :: Mult
</span><a href="#local-6989586621681122788"><span class="hs-identifier hs-var hs-var">poly_res_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122800"><span class="hs-identifier hs-var">m2_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span>
</span><span id="line-638"></span><span>             </span><span id="local-6989586621681122787"><span class="annot"><span class="annottext">using_res_ty :: Mult
</span><a href="#local-6989586621681122787"><span class="hs-identifier hs-var hs-var">using_res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122800"><span class="hs-identifier hs-var">m2_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122799"><span class="hs-identifier hs-var">tup_ty</span></a></span><span>
</span><span id="line-639"></span><span>             </span><span id="local-6989586621681122786"><span class="annot"><span class="annottext">using_poly_ty :: Mult
</span><a href="#local-6989586621681122786"><span class="hs-identifier hs-var hs-var">using_poly_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkInfForAllTy"><span class="hs-identifier hs-var">mkInfForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-640"></span><span>                             </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122793"><span class="hs-identifier hs-var">by_arrow</span></a></span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-641"></span><span>                             </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122790"><span class="hs-identifier hs-var">poly_arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122788"><span class="hs-identifier hs-var">poly_res_ty</span></a></span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span>             </span><span class="hs-comment">-- 'stmts' returns a result of type (m1_ty tuple_ty),</span><span>
</span><span id="line-644"></span><span>             </span><span class="hs-comment">-- typically something like [(Int,Bool,Int)]</span><span>
</span><span id="line-645"></span><span>             </span><span class="hs-comment">-- We don't know what tuple_ty is yet, so we use a variable</span><span>
</span><span id="line-646"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122785"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122785"><span class="hs-identifier hs-var">bndr_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122784"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122784"><span class="hs-identifier hs-var">n_bndr_names</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, Name)] -&gt; ([Name], [Name])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, Name)]
[(IdP GhcRn, IdP GhcRn)]
</span><a href="#local-6989586621681122811"><span class="hs-identifier hs-var">bindersMap</span></a></span><span>
</span><span id="line-647"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122783"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122783"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122782"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122782"><span class="hs-identifier hs-var">bndr_ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122781"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681122781"><span class="hs-identifier hs-var">by'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122780"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122780"><span class="hs-identifier hs-var">return_op'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-648"></span><span>            </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsStmtContext GhcRn
forall p. HsStmtContext p -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#TransStmtCtxt"><span class="hs-identifier hs-var">TransStmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122813"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122812"><span class="hs-identifier hs-var">stmts</span></a></span><span>
</span><span id="line-649"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122789"><span class="hs-identifier hs-var">using_arg_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc))
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)],
       ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc)))
-&gt; (ExpRhoType -&gt; TcM ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122779"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122779"><span class="hs-identifier hs-var">res_ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-650"></span><span>                </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122778"><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681122778"><span class="hs-identifier hs-var">by'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="#local-6989586621681122810"><span class="hs-identifier hs-var">by</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-651"></span><span>                           </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcRn)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (LHsExpr GhcTc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-652"></span><span>                           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681122777"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122777"><span class="hs-identifier hs-var">e</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122776"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122776"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122777"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122798"><span class="hs-identifier hs-var">by_e_ty</span></a></span><span>
</span><span id="line-653"></span><span>                                         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (LHsExpr GhcTc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; Maybe (LHsExpr GhcTc)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122776"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-654"></span><span>
</span><span id="line-655"></span><span>                </span><span class="hs-comment">-- Find the Ids (and hence types) of all old binders</span><span>
</span><span id="line-656"></span><span>                </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122775"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122775"><span class="hs-identifier hs-var">bndr_ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; TcM [Id]
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocalIds"><span class="hs-identifier hs-var">tcLookupLocalIds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122785"><span class="hs-identifier hs-var">bndr_names</span></a></span><span>
</span><span id="line-657"></span><span>
</span><span id="line-658"></span><span>                </span><span class="hs-comment">-- 'return' is only used for the binders, so we know its type.</span><span>
</span><span id="line-659"></span><span>                </span><span class="hs-comment">--   return :: (a,b,c,..) -&gt; m (a,b,c,..)</span><span>
</span><span id="line-660"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122774"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122774"><span class="hs-identifier hs-var">return_op'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122807"><span class="hs-identifier hs-var">return_op</span></a></span><span>
</span><span id="line-661"></span><span>                                       </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id] -&gt; Mult
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122775"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-662"></span><span>                                       </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122779"><span class="hs-identifier hs-var">res_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-663"></span><span>
</span><span id="line-664"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc)
-&gt; TcM ([Id], Maybe (LHsExpr GhcTc), SyntaxExprTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122775"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681122778"><span class="hs-identifier hs-var">by'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122774"><span class="hs-identifier hs-var">return_op'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-665"></span><span>
</span><span id="line-666"></span><span>       </span><span class="hs-comment">--------------- Typecheck the 'bind' function -------------</span><span>
</span><span id="line-667"></span><span>       </span><span class="hs-comment">-- (&gt;&gt;=) :: m2 (n (a,b,c)) -&gt; ( n (a,b,c) -&gt; new_res_ty ) -&gt; res_ty</span><span>
</span><span id="line-668"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122772"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122772"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-669"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122771"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122771"><span class="hs-identifier hs-var">bind_op'</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122806"><span class="hs-identifier hs-var">bind_op</span></a></span><span>
</span><span id="line-670"></span><span>                             </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122787"><span class="hs-identifier hs-var">using_res_ty</span></a></span><span>
</span><span id="line-671"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122799"><span class="hs-identifier hs-var">tup_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122772"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-672"></span><span>                             </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122804"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-673"></span><span>
</span><span id="line-674"></span><span>       </span><span class="hs-comment">--------------- Typecheck the 'fmap' function -------------</span><span>
</span><span id="line-675"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122770"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122770"><span class="hs-identifier hs-var">fmap_op'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681122808"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-676"></span><span>                       </span><span class="annot"><span class="annottext">TransForm
</span><a href="GHC.Hs.Expr.html#ThenForm"><span class="hs-identifier hs-var">ThenForm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc -&gt; TcM (HsExpr GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
forall (p :: Pass). HsExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noExpr"><span class="hs-identifier hs-var">noExpr</span></a></span><span>
</span><span id="line-677"></span><span>                       </span><span class="annot"><span class="annottext">TransForm
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; HsExpr GhcTc)
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (HsExpr GhcTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; HsExpr GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (HsExpr GhcTc))
-&gt; (Mult -&gt; TcM (LHsExpr GhcTc)) -&gt; Mult -&gt; TcM (HsExpr GhcTc)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier hs-var">tcCheckPolyExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; LHsExpr GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681122805"><span class="hs-identifier hs-var">fmap_op</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; TcM (HsExpr GhcTc)) -&gt; Mult -&gt; TcM (HsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-678"></span><span>                            </span><span class="annot"><span class="annottext">Id -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkInfForAllTy"><span class="hs-identifier hs-var">mkInfForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-679"></span><span>                            </span><span class="annot"><span class="annottext">Id -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkInfForAllTy"><span class="hs-identifier hs-var">mkInfForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#betaTyVar"><span class="hs-identifier hs-var">betaTyVar</span></a></span><span>  </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-680"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#betaTy"><span class="hs-identifier hs-var">betaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-681"></span><span>                            </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-682"></span><span>                            </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#betaTy"><span class="hs-identifier hs-var">betaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-683"></span><span>
</span><span id="line-684"></span><span>       </span><span class="hs-comment">--------------- Typecheck the 'using' function -------------</span><span>
</span><span id="line-685"></span><span>       </span><span class="hs-comment">-- using :: ((a,b,c)-&gt;t) -&gt; m1 (a,b,c) -&gt; m2 (n (a,b,c))</span><span>
</span><span id="line-686"></span><span>
</span><span id="line-687"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122766"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122766"><span class="hs-identifier hs-var">using'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier hs-var">tcCheckPolyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122809"><span class="hs-identifier hs-var">using</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122786"><span class="hs-identifier hs-var">using_poly_ty</span></a></span><span>
</span><span id="line-688"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122765"><span class="annot"><span class="annottext">final_using :: LHsExpr GhcTc
</span><a href="#local-6989586621681122765"><span class="hs-identifier hs-var hs-var">final_using</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc -&gt; HsExpr GhcTc) -&gt; LHsExpr GhcTc -&gt; LHsExpr GhcTc
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; HsExpr GhcTc -&gt; HsExpr GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsWrap"><span class="hs-identifier hs-var">mkHsWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#WpTyApp"><span class="hs-identifier hs-var">WpTyApp</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122799"><span class="hs-identifier hs-var">tup_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122766"><span class="hs-identifier hs-var">using'</span></a></span><span>
</span><span id="line-689"></span><span>
</span><span id="line-690"></span><span>       </span><span class="hs-comment">--------------- Building the bindersMap ----------------</span><span>
</span><span id="line-691"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="#local-6989586621681122764"><span class="hs-identifier hs-type">mk_n_bndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcId"><span class="hs-identifier hs-type">TcId</span></a></span><span>
</span><span id="line-692"></span><span>             </span><span id="local-6989586621681122764"><span class="annot"><span class="annottext">mk_n_bndr :: Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681122764"><span class="hs-identifier hs-var hs-var">mk_n_bndr</span></a></span></span><span> </span><span id="local-6989586621681122763"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122763"><span class="hs-identifier hs-var">n_bndr_name</span></a></span></span><span> </span><span id="local-6989586621681122762"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681122762"><span class="hs-identifier hs-var">bndr_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Mult -&gt; Mult -&gt; Id
Name -&gt; Mult -&gt; Mult -&gt; Id
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122763"><span class="hs-identifier hs-var">n_bndr_name</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Mult
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681122762"><span class="hs-identifier hs-var">bndr_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>
</span><span id="line-694"></span><span>             </span><span class="hs-comment">-- Ensure that every old binder of type `b` is linked up with its</span><span>
</span><span id="line-695"></span><span>             </span><span class="hs-comment">-- new binder which should have type `n b`</span><span>
</span><span id="line-696"></span><span>             </span><span class="hs-comment">-- See Note [GroupStmt binder map] in GHC.Hs.Expr</span><span>
</span><span id="line-697"></span><span>             </span><span id="local-6989586621681122761"><span class="annot"><span class="annottext">n_bndr_ids :: [Id]
</span><a href="#local-6989586621681122761"><span class="hs-identifier hs-var hs-var">n_bndr_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (Name -&gt; Id -&gt; Id) -&gt; [Name] -&gt; [Id] -&gt; [Id]
forall a b c. String -&gt; (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="GHC.Utils.Misc.html#zipWithEqual"><span class="hs-identifier hs-var">zipWithEqual</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcMcStmt&quot;</span></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Id -&gt; Id
</span><a href="#local-6989586621681122764"><span class="hs-identifier hs-var">mk_n_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122784"><span class="hs-identifier hs-var">n_bndr_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122782"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span>
</span><span id="line-698"></span><span>             </span><span id="local-6989586621681122759"><span class="annot"><span class="annottext">bindersMap' :: [(Id, Id)]
</span><a href="#local-6989586621681122759"><span class="hs-identifier hs-var hs-var">bindersMap'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122782"><span class="hs-identifier hs-var">bndr_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; [Id] -&gt; [(Id, Id)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122761"><span class="hs-identifier hs-var">n_bndr_ids</span></a></span><span>
</span><span id="line-699"></span><span>
</span><span id="line-700"></span><span>       </span><span class="hs-comment">-- Type check the thing in the environment with</span><span>
</span><span id="line-701"></span><span>       </span><span class="hs-comment">-- these new binders and return the result</span><span>
</span><span id="line-702"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122758"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122758"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; TcM thing -&gt; TcM thing
forall a. [Id] -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Env.html#tcExtendIdEnv"><span class="hs-identifier hs-var">tcExtendIdEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122761"><span class="hs-identifier hs-var">n_bndr_ids</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM thing) -&gt; TcM thing -&gt; TcM thing
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-703"></span><span>                  </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122803"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122772"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-704"></span><span>
</span><span id="line-705"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TransStmt :: forall idL idR body.
XTransStmt idL idR body
-&gt; TransForm
-&gt; [ExprLStmt idL]
-&gt; [(IdP idR, IdP idR)]
-&gt; LHsExpr idR
-&gt; Maybe (LHsExpr idR)
-&gt; SyntaxExpr idR
-&gt; SyntaxExpr idR
-&gt; HsExpr idR
-&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#TransStmt"><span class="hs-identifier hs-type">TransStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">trS_stmts :: [LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="GHC.Hs.Expr.html#trS_stmts"><span class="hs-identifier hs-var">trS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122783"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bndrs :: [(IdP GhcTc, IdP GhcTc)]
</span><a href="GHC.Hs.Expr.html#trS_bndrs"><span class="hs-identifier hs-var">trS_bndrs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Id, Id)]
[(IdP GhcTc, IdP GhcTc)]
</span><a href="#local-6989586621681122759"><span class="hs-identifier hs-var">bindersMap'</span></a></span><span>
</span><span id="line-706"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_by :: Maybe (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#trS_by"><span class="hs-identifier hs-var">trS_by</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
</span><a href="#local-6989586621681122781"><span class="hs-identifier hs-var">by'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_using :: LHsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_using"><span class="hs-identifier hs-var">trS_using</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122765"><span class="hs-identifier hs-var">final_using</span></a></span><span>
</span><span id="line-707"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ret :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_ret"><span class="hs-identifier hs-var">trS_ret</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122780"><span class="hs-identifier hs-var">return_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_bind :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_bind"><span class="hs-identifier hs-var">trS_bind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122771"><span class="hs-identifier hs-var">bind_op'</span></a></span><span>
</span><span id="line-708"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_ext :: XTransStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#trS_ext"><span class="hs-identifier hs-var">trS_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult
</span><a href="#local-6989586621681122797"><span class="hs-identifier hs-var">n_app</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122799"><span class="hs-identifier hs-var">tup_ty</span></a></span><span>
</span><span id="line-709"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_fmap :: HsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#trS_fmap"><span class="hs-identifier hs-var">trS_fmap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122770"><span class="hs-identifier hs-var">fmap_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">trS_form :: TransForm
</span><a href="GHC.Hs.Expr.html#trS_form"><span class="hs-identifier hs-var">trS_form</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TransForm
</span><a href="#local-6989586621681122808"><span class="hs-identifier hs-var">form</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122758"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span class="hs-comment">-- A parallel set of comprehensions</span><span>
</span><span id="line-712"></span><span class="hs-comment">--      [ (g x, h x) | ... ; let g v = ...</span><span>
</span><span id="line-713"></span><span class="hs-comment">--                   | ... ; let h v = ... ]</span><span>
</span><span id="line-714"></span><span class="hs-comment">--</span><span>
</span><span id="line-715"></span><span class="hs-comment">-- It's possible that g,h are overloaded, so we need to feed the LIE from the</span><span>
</span><span id="line-716"></span><span class="hs-comment">-- (g x, h x) up through both lots of bindings (so we get the bindLocalMethods).</span><span>
</span><span id="line-717"></span><span class="hs-comment">-- Similarly if we had an existential pattern match:</span><span>
</span><span id="line-718"></span><span class="hs-comment">--</span><span>
</span><span id="line-719"></span><span class="hs-comment">--      data T = forall a. Show a =&gt; C a</span><span>
</span><span id="line-720"></span><span class="hs-comment">--</span><span>
</span><span id="line-721"></span><span class="hs-comment">--      [ (show x, show y) | ... ; C x &lt;- ...</span><span>
</span><span id="line-722"></span><span class="hs-comment">--                         | ... ; C y &lt;- ... ]</span><span>
</span><span id="line-723"></span><span class="hs-comment">--</span><span>
</span><span id="line-724"></span><span class="hs-comment">-- Then we need the LIE from (show x, show y) to be simplified against</span><span>
</span><span id="line-725"></span><span class="hs-comment">-- the bindings for x and y.</span><span>
</span><span id="line-726"></span><span class="hs-comment">--</span><span>
</span><span id="line-727"></span><span class="hs-comment">-- It's difficult to do this in parallel, so we rely on the renamer to</span><span>
</span><span id="line-728"></span><span class="hs-comment">-- ensure that g,h and x,y don't duplicate, and simply grow the environment.</span><span>
</span><span id="line-729"></span><span class="hs-comment">-- So the binders of the first parallel group will be in scope in the second</span><span>
</span><span id="line-730"></span><span class="hs-comment">-- group.  But that's fine; there's no shadowing to worry about.</span><span>
</span><span id="line-731"></span><span class="hs-comment">--</span><span>
</span><span id="line-732"></span><span class="hs-comment">-- Note: The `mzip` function will get typechecked via:</span><span>
</span><span id="line-733"></span><span class="hs-comment">--</span><span>
</span><span id="line-734"></span><span class="hs-comment">--   ParStmt [st1::t1, st2::t2, st3::t3]</span><span>
</span><span id="line-735"></span><span class="hs-comment">--</span><span>
</span><span id="line-736"></span><span class="hs-comment">--   mzip :: m st1</span><span>
</span><span id="line-737"></span><span class="hs-comment">--        -&gt; (m st2 -&gt; m st3 -&gt; m (st2, st3))   -- recursive call</span><span>
</span><span id="line-738"></span><span class="hs-comment">--        -&gt; m (st1, (st2, st3))</span><span>
</span><span id="line-739"></span><span class="hs-comment">--</span><span>
</span><span id="line-740"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span id="local-6989586621681122757"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122757"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-type">ParStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122756"><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681122756"><span class="hs-identifier hs-var">bndr_stmts_s</span></a></span></span><span> </span><span id="local-6989586621681122755"><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681122755"><span class="hs-identifier hs-var">mzip_op</span></a></span></span><span> </span><span id="local-6989586621681122754"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122754"><span class="hs-identifier hs-var">bind_op</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122753"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122753"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122752"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122752"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-741"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122751"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122751"><span class="hs-identifier hs-var">m_ty</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#typeToTypeKind"><span class="hs-identifier hs-var">typeToTypeKind</span></a></span><span>
</span><span id="line-742"></span><span>
</span><span id="line-743"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122750"><span class="annot"><span class="annottext">mzip_ty :: Mult
</span><a href="#local-6989586621681122750"><span class="hs-identifier hs-var hs-var">mzip_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkInfForAllTys"><span class="hs-identifier hs-var">mkInfForAllTys</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="GHC.Builtin.Types.Prim.html#betaTyVar"><span class="hs-identifier hs-var">betaTyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult) -&gt; Mult -&gt; Mult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-744"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122751"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-745"></span><span>                        </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span>
</span><span id="line-746"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122751"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#betaTy"><span class="hs-identifier hs-var">betaTy</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-747"></span><span>                        </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-operator hs-var">`mkVisFunTyMany`</span></a></span><span>
</span><span id="line-748"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122751"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; Mult
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.Prim.html#betaTy"><span class="hs-identifier hs-var">betaTy</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-749"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122747"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122747"><span class="hs-identifier hs-var">mzip_op'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; HsExpr GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; HsExpr GhcTc)
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (HsExpr GhcTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier hs-var">tcCheckPolyExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; LHsExpr GhcRn
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681122755"><span class="hs-identifier hs-var">mzip_op</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122750"><span class="hs-identifier hs-var">mzip_ty</span></a></span><span>
</span><span id="line-750"></span><span>
</span><span id="line-751"></span><span>        </span><span class="hs-comment">-- type dummies since we don't know all binder types yet</span><span>
</span><span id="line-752"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122746"><span class="annot"><span class="annottext">[[Mult]]
</span><a href="#local-6989586621681122746"><span class="hs-identifier hs-var">id_tys_s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult])
-&gt; [[Name]] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [[Mult]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">(([Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult])
 -&gt; [[Name]] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [[Mult]])
-&gt; ((Name -&gt; TcM Mult)
    -&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult])
-&gt; (Name -&gt; TcM Mult)
-&gt; [[Name]]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [[Mult]]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; TcM Mult)
-&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcM Mult -&gt; Name -&gt; TcM Mult
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-753"></span><span>                       </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122745"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcRn GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122745"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681122745"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681122756"><span class="hs-identifier hs-var">bndr_stmts_s</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-754"></span><span>
</span><span id="line-755"></span><span>       </span><span class="hs-comment">-- Typecheck bind:</span><span>
</span><span id="line-756"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122744"><span class="annot"><span class="annottext">tup_tys :: [Mult]
</span><a href="#local-6989586621681122744"><span class="hs-identifier hs-var hs-var">tup_tys</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; Mult
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122742"><span class="hs-identifier hs-var">id_tys</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681122742"><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122742"><span class="hs-identifier hs-var">id_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[Mult]]
</span><a href="#local-6989586621681122746"><span class="hs-identifier hs-var">id_tys_s</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-757"></span><span>             </span><span id="local-6989586621681122741"><span class="annot"><span class="annottext">tuple_ty :: Mult
</span><a href="#local-6989586621681122741"><span class="hs-identifier hs-var hs-var">tuple_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; Mult
forall {t :: * -&gt; *}. Foldable t =&gt; t Mult -&gt; Mult
</span><a href="#local-6989586621681122740"><span class="hs-identifier hs-var">mk_tuple_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122744"><span class="hs-identifier hs-var">tup_tys</span></a></span><span>
</span><span id="line-758"></span><span>
</span><span id="line-759"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122739"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681122739"><span class="hs-identifier hs-var">blocks'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122738"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122738"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122737"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122737"><span class="hs-identifier hs-var">inner_res_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122736"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122736"><span class="hs-identifier hs-var">bind_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-760"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult]
    -&gt; [Mult] -&gt; TcM (([ParStmtBlock GhcTc GhcTc], thing), Mult))
-&gt; TcM ((([ParStmtBlock GhcTc GhcTc], thing), Mult), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122754"><span class="hs-identifier hs-var">bind_op</span></a></span><span>
</span><span id="line-761"></span><span>                         </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122751"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122741"><span class="hs-identifier hs-var">tuple_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-762"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType -&gt; SyntaxOpType -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynFun"><span class="hs-identifier hs-var">SynFun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122741"><span class="hs-identifier hs-var">tuple_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span> </span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122753"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult]
  -&gt; [Mult] -&gt; TcM (([ParStmtBlock GhcTc GhcTc], thing), Mult))
 -&gt; TcM ((([ParStmtBlock GhcTc GhcTc], thing), Mult), SyntaxExprTc))
-&gt; ([Mult]
    -&gt; [Mult] -&gt; TcM (([ParStmtBlock GhcTc GhcTc], thing), Mult))
-&gt; TcM ((([ParStmtBlock GhcTc GhcTc], thing), Mult), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-763"></span><span>              </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122735"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122735"><span class="hs-identifier hs-var">inner_res_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-764"></span><span>              </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122734"><span class="annot"><span class="annottext">([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681122734"><span class="hs-identifier hs-var">stuff</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; ExpRhoType
-&gt; [Mult]
-&gt; [ParStmtBlock GhcRn GhcRn]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681122733"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122751"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122735"><span class="hs-identifier hs-var">inner_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-765"></span><span>                                 </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122744"><span class="hs-identifier hs-var">tup_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681122756"><span class="hs-identifier hs-var">bndr_stmts_s</span></a></span><span>
</span><span id="line-766"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(([ParStmtBlock GhcTc GhcTc], thing), Mult)
-&gt; TcM (([ParStmtBlock GhcTc GhcTc], thing), Mult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681122734"><span class="hs-identifier hs-var">stuff</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122735"><span class="hs-identifier hs-var">inner_res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-767"></span><span>
</span><span id="line-768"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XParStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; [ParStmtBlock GhcTc GhcTc]
-&gt; HsExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XParStmt idL idR body
-&gt; [ParStmtBlock idL idR]
-&gt; HsExpr idR
-&gt; SyntaxExpr idR
-&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#ParStmt"><span class="hs-identifier hs-var">ParStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XParStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681122737"><span class="hs-identifier hs-var">inner_res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681122739"><span class="hs-identifier hs-var">blocks'</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122747"><span class="hs-identifier hs-var">mzip_op'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122736"><span class="hs-identifier hs-var">bind_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122738"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-771"></span><span>    </span><span id="local-6989586621681122740"><span class="annot"><span class="annottext">mk_tuple_ty :: t Mult -&gt; Mult
</span><a href="#local-6989586621681122740"><span class="hs-identifier hs-var hs-var">mk_tuple_ty</span></a></span></span><span> </span><span id="local-6989586621681122730"><span class="annot"><span class="annottext">t Mult
</span><a href="#local-6989586621681122730"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Mult -&gt; Mult -&gt; Mult) -&gt; t Mult -&gt; Mult
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681122728"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122728"><span class="hs-identifier hs-var">tn</span></a></span></span><span> </span><span id="local-6989586621681122727"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122727"><span class="hs-identifier hs-var">tm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; Mult
</span><a href="GHC.Builtin.Types.html#mkBoxedTupleTy"><span class="hs-identifier hs-var">mkBoxedTupleTy</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122728"><span class="hs-identifier hs-var">tn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122727"><span class="hs-identifier hs-var">tm</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">t Mult
</span><a href="#local-6989586621681122730"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span>       </span><span class="hs-comment">-- loop :: Type                                  -- m_ty</span><span>
</span><span id="line-774"></span><span>       </span><span class="hs-comment">--      -&gt; ExpRhoType                            -- inner_res_ty</span><span>
</span><span id="line-775"></span><span>       </span><span class="hs-comment">--      -&gt; [TcType]                              -- tup_tys</span><span>
</span><span id="line-776"></span><span>       </span><span class="hs-comment">--      -&gt; [ParStmtBlock Name]</span><span>
</span><span id="line-777"></span><span>       </span><span class="hs-comment">--      -&gt; TcM ([([LStmt GhcTc], [TcId])], thing)</span><span>
</span><span id="line-778"></span><span>    </span><span id="local-6989586621681122733"><span class="annot"><span class="annottext">loop :: Mult
-&gt; ExpRhoType
-&gt; [Mult]
-&gt; [ParStmtBlock GhcRn GhcRn]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681122733"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="annot"><span class="annottext">Mult
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122726"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122726"><span class="hs-identifier hs-var">inner_res_ty</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122725"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122725"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122752"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122726"><span class="hs-identifier hs-var">inner_res_ty</span></a></span><span>
</span><span id="line-779"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([ParStmtBlock GhcTc GhcTc], thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122725"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-780"></span><span>                                   </span><span class="hs-comment">-- matching in the branches</span><span>
</span><span id="line-781"></span><span>
</span><span id="line-782"></span><span>    </span><span class="annot"><a href="#local-6989586621681122733"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span id="local-6989586621681122724"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122724"><span class="hs-identifier hs-var">m_ty</span></a></span></span><span> </span><span id="local-6989586621681122723"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122723"><span class="hs-identifier hs-var">inner_res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122722"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122722"><span class="hs-identifier hs-var">tup_ty_in</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681122721"><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122721"><span class="hs-identifier hs-var">tup_tys_in</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-783"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-type">ParStmtBlock</span></a></span><span> </span><span id="local-6989586621681122720"><span class="annot"><span class="annottext">XParStmtBlock GhcRn GhcRn
</span><a href="#local-6989586621681122720"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681122719"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122719"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681122718"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681122718"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681122717"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122717"><span class="hs-identifier hs-var">return_op</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681122716"><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681122716"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-784"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122715"><span class="annot"><span class="annottext">m_tup_ty :: Mult
</span><a href="#local-6989586621681122715"><span class="hs-identifier hs-var hs-var">m_tup_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122724"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.Type.html#mkAppTy"><span class="hs-operator hs-var">`mkAppTy`</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122722"><span class="hs-identifier hs-var">tup_ty_in</span></a></span><span>
</span><span id="line-785"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122714"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122714"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122713"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122713"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122712"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122712"><span class="hs-identifier hs-var">return_op'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122711"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681122711"><span class="hs-identifier hs-var">pairs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122710"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122710"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-786"></span><span>                </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType
    -&gt; TcM ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122757"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122719"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122715"><span class="hs-identifier hs-var">m_tup_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ExpRhoType
  -&gt; TcM ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing))
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)],
       ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing)))
-&gt; (ExpRhoType
    -&gt; TcM ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-787"></span><span>                   </span><span class="hs-glyph">\</span><span id="local-6989586621681122709"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122709"><span class="hs-identifier hs-var">m_tup_ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-788"></span><span>                   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122708"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122708"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; TcM [Id]
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocalIds"><span class="hs-identifier hs-var">tcLookupLocalIds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122718"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-789"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122707"><span class="annot"><span class="annottext">tup_ty :: Mult
</span><a href="#local-6989586621681122707"><span class="hs-identifier hs-var hs-var">tup_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; Mult
</span><a href="GHC.Core.Make.html#mkBigCoreVarTupTy"><span class="hs-identifier hs-var">mkBigCoreVarTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122708"><span class="hs-identifier hs-var">ids</span></a></span><span>
</span><span id="line-790"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122706"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122706"><span class="hs-identifier hs-var">return_op'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-791"></span><span>                          </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#MCompOrigin"><span class="hs-identifier hs-var">MCompOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122717"><span class="hs-identifier hs-var">return_op</span></a></span><span>
</span><span id="line-792"></span><span>                                     </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122707"><span class="hs-identifier hs-var">tup_ty</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122709"><span class="hs-identifier hs-var">m_tup_ty'</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-793"></span><span>                                     </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-794"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122705"><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681122705"><span class="hs-identifier hs-var">pairs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122704"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122704"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; ExpRhoType
-&gt; [Mult]
-&gt; [ParStmtBlock GhcRn GhcRn]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
</span><a href="#local-6989586621681122733"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122724"><span class="hs-identifier hs-var">m_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122723"><span class="hs-identifier hs-var">inner_res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122721"><span class="hs-identifier hs-var">tup_tys_in</span></a></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><a href="#local-6989586621681122716"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-795"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing)
-&gt; TcM ([Id], SyntaxExprTc, [ParStmtBlock GhcTc GhcTc], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122708"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122706"><span class="hs-identifier hs-var">return_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681122705"><span class="hs-identifier hs-var">pairs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122704"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-796"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([ParStmtBlock GhcTc GhcTc], thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XParStmtBlock GhcTc GhcTc
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; [IdP GhcTc]
-&gt; SyntaxExpr GhcTc
-&gt; ParStmtBlock GhcTc GhcTc
forall idL idR.
XParStmtBlock idL idR
-&gt; [ExprLStmt idL]
-&gt; [IdP idR]
-&gt; SyntaxExpr idR
-&gt; ParStmtBlock idL idR
</span><a href="GHC.Hs.Expr.html#ParStmtBlock"><span class="hs-identifier hs-var">ParStmtBlock</span></a></span><span> </span><span class="annot"><span class="annottext">XParStmtBlock GhcRn GhcRn
XParStmtBlock GhcTc GhcTc
</span><a href="#local-6989586621681122720"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122714"><span class="hs-identifier hs-var">stmts'</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681122713"><span class="hs-identifier hs-var">ids</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122712"><span class="hs-identifier hs-var">return_op'</span></a></span><span> </span><span class="annot"><span class="annottext">ParStmtBlock GhcTc GhcTc
-&gt; [ParStmtBlock GhcTc GhcTc] -&gt; [ParStmtBlock GhcTc GhcTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcTc GhcTc]
</span><a href="#local-6989586621681122711"><span class="hs-identifier hs-var">pairs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122710"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-797"></span><span>    </span><span class="annot"><a href="#local-6989586621681122733"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[ParStmtBlock GhcRn GhcRn]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([ParStmtBlock GhcTc GhcTc], thing)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcMcStmt.loop&quot;</span></span><span>
</span><span id="line-798"></span><span>
</span><span id="line-799"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMcStmt"><span class="hs-identifier hs-var">tcMcStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122703"><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122703"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-800"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcMcStmt: unexpected Stmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122703"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-801"></span><span>
</span><span id="line-802"></span><span>
</span><span id="line-803"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-804"></span><span class="hs-comment">--           Do-notation</span><span>
</span><span id="line-805"></span><span class="hs-comment">--        (supports rebindable syntax)</span><span>
</span><span id="line-806"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-807"></span><span>
</span><span id="line-808"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-type">tcDoStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcExprStmtChecker"><span class="hs-identifier hs-type">TcExprStmtChecker</span></a></span><span>
</span><span id="line-809"></span><span>
</span><span id="line-810"></span><span id="tcDoStmt"><span class="annot"><span class="annottext">tcDoStmt :: TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var hs-var">tcDoStmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span id="local-6989586621681122640"><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122640"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681122639"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122639"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681122638"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681122638"><span class="hs-identifier hs-var">noret</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122637"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122637"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122636"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122636"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-811"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122635"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122635"><span class="hs-identifier hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcMonoExprNC"><span class="hs-identifier hs-var">tcMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122639"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122637"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-812"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122634"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122634"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122636"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ExpRhoType
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcDoStmt: thing_inside&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-813"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; Maybe Bool
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XLastStmt idL idR body
-&gt; body -&gt; Maybe Bool -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-var">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsExpr GhcRn)
XLastStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681122640"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122635"><span class="hs-identifier hs-var">body'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681122638"><span class="hs-identifier hs-var">noret</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122634"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-814"></span><span>
</span><span id="line-815"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span id="local-6989586621681122633"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122633"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span id="local-6989586621681122632"><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122632"><span class="hs-identifier hs-var">xbsrn</span></a></span></span><span> </span><span id="local-6989586621681122631"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122631"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681122630"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122630"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122629"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122629"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122628"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122628"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-816"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- Deal with rebindable syntax:</span><span>
</span><span id="line-817"></span><span>                </span><span class="hs-comment">--       (&gt;&gt;=) :: rhs_ty -&gt;_rhs_mult (pat_ty -&gt;_pat_mult new_res_ty) -&gt;_fun_mult res_ty</span><span>
</span><span id="line-818"></span><span>                </span><span class="hs-comment">-- This level of generality is needed for using do-notation</span><span>
</span><span id="line-819"></span><span>                </span><span class="hs-comment">-- in full generality; see #1537</span><span>
</span><span id="line-820"></span><span>
</span><span id="line-821"></span><span>          </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122627"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122627"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122626"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122626"><span class="hs-identifier hs-var">pat_mult</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122625"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122625"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122624"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122624"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122623"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122623"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122622"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122622"><span class="hs-identifier hs-var">bind_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-822"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult]
    -&gt; [Mult]
    -&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing))
-&gt; TcM
     ((LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing),
      SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtRn -&gt; SyntaxExpr GhcRn
</span><a href="GHC.Hs.Expr.html#xbsrn_bindOp"><span class="hs-identifier hs-var hs-var">xbsrn_bindOp</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
XBindStmtRn
</span><a href="#local-6989586621681122632"><span class="hs-identifier hs-var">xbsrn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType -&gt; SyntaxOpType -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynFun"><span class="hs-identifier hs-var">SynFun</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynAny"><span class="hs-identifier hs-var">SynAny</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122629"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult]
  -&gt; [Mult]
  -&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing))
 -&gt; TcM
      ((LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing),
       SyntaxExprTc))
-&gt; ([Mult]
    -&gt; [Mult]
    -&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing))
-&gt; TcM
     ((LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing),
      SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-823"></span><span>                </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122620"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122620"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122619"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122619"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122618"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122618"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122617"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122617"><span class="hs-identifier hs-var">rhs_mult</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681122616"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122616"><span class="hs-identifier hs-var">fun_mult</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681122615"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122615"><span class="hs-identifier hs-var">pat_mult</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-824"></span><span>                </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122614"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122614"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122617"><span class="hs-identifier hs-var">rhs_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExprNC"><span class="hs-identifier hs-var">tcCheckMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122630"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122620"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-825"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122613"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122613"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122612"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122612"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; TcM (Located (Pat GhcTc), thing)
-&gt; TcM (Located (Pat GhcTc), thing)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122616"><span class="hs-identifier hs-var">fun_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Located (Pat GhcTc), thing)
 -&gt; TcM (Located (Pat GhcTc), thing))
-&gt; TcM (Located (Pat GhcTc), thing)
-&gt; TcM (Located (Pat GhcTc), thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn
-&gt; Scaled Mult
-&gt; TcM thing
-&gt; TcM (LPat GhcTc, thing)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122633"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122631"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Scaled Mult
forall a. Mult -&gt; a -&gt; Scaled a
</span><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-var">Scaled</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122615"><span class="hs-identifier hs-var">pat_mult</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122619"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM (LPat GhcTc, thing))
-&gt; TcM thing -&gt; TcM (LPat GhcTc, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-826"></span><span>                                      </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122628"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122618"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing)
-&gt; TcM (LHsExpr GhcTc, Mult, Located (Pat GhcTc), Mult, thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122614"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122615"><span class="hs-identifier hs-var">pat_mult</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122613"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122618"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122612"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-828"></span><span>
</span><span id="line-829"></span><span>        </span><span class="hs-comment">-- If (but only if) the pattern can fail, typecheck the 'fail' operator</span><span>
</span><span id="line-830"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122611"><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="#local-6989586621681122611"><span class="hs-identifier hs-var">fail_op'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Maybe (Maybe SyntaxExprTc) -&gt; Maybe SyntaxExprTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe SyntaxExprTc) -&gt; Maybe SyntaxExprTc
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; ((SyntaxExprRn
     -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc)))
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprRn
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmtRn -&gt; FailOperator GhcRn
</span><a href="GHC.Hs.Expr.html#xbsrn_failOp"><span class="hs-identifier hs-var hs-var">xbsrn_failOp</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsExpr GhcRn)
XBindStmtRn
</span><a href="#local-6989586621681122632"><span class="hs-identifier hs-var">xbsrn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((SyntaxExprRn
  -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122610"><span class="annot"><span class="annottext">SyntaxExprRn
</span><a href="#local-6989586621681122610"><span class="hs-identifier hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-831"></span><span>            </span><span class="annot"><span class="annottext">CtOrigin
-&gt; LPat GhcTc
-&gt; SyntaxExpr GhcRn
-&gt; Mult
-&gt; TcRn (FailOperator GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcMonadFailOp"><span class="hs-identifier hs-var">tcMonadFailOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcRn -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoPatOrigin"><span class="hs-identifier hs-var">DoPatOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122631"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122625"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122610"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122624"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span>
</span><span id="line-832"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122608"><span class="annot"><span class="annottext">xbstc :: XBindStmtTc
</span><a href="#local-6989586621681122608"><span class="hs-identifier hs-var hs-var">xbstc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XBindStmtTc :: SyntaxExpr GhcTc
-&gt; Mult -&gt; Mult -&gt; FailOperator GhcTc -&gt; XBindStmtTc
</span><a href="GHC.Hs.Expr.html#XBindStmtTc"><span class="hs-identifier hs-type">XBindStmtTc</span></a></span><span>
</span><span id="line-833"></span><span>                </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">xbstc_bindOp :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#xbstc_bindOp"><span class="hs-identifier hs-var">xbstc_bindOp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122622"><span class="hs-identifier hs-var">bind_op'</span></a></span><span>
</span><span id="line-834"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">xbstc_boundResultType :: Mult
</span><a href="GHC.Hs.Expr.html#xbstc_boundResultType"><span class="hs-identifier hs-var">xbstc_boundResultType</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122624"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span>
</span><span id="line-835"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">xbstc_boundResultMult :: Mult
</span><a href="GHC.Hs.Expr.html#xbstc_boundResultMult"><span class="hs-identifier hs-var">xbstc_boundResultMult</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122626"><span class="hs-identifier hs-var">pat_mult</span></a></span><span>
</span><span id="line-836"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">xbstc_failOp :: FailOperator GhcTc
</span><a href="GHC.Hs.Expr.html#xbstc_failOp"><span class="hs-identifier hs-var">xbstc_failOp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FailOperator GhcTc
Maybe SyntaxExprTc
</span><a href="#local-6989586621681122611"><span class="hs-identifier hs-var">fail_op'</span></a></span><span>
</span><span id="line-837"></span><span>                </span><span class="hs-special">}</span><span>
</span><span id="line-838"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LPat GhcTc -&gt; LHsExpr GhcTc -&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XBindStmt idL idR body -&gt; LPat idL -&gt; body -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-var">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcTc GhcTc (LHsExpr GhcTc)
XBindStmtTc
</span><a href="#local-6989586621681122608"><span class="hs-identifier hs-var">xbstc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122625"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122627"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122623"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-839"></span><span>
</span><span id="line-840"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span id="local-6989586621681122607"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122607"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeStmt"><span class="hs-identifier hs-type">ApplicativeStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XApplicativeStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122606"><span class="annot"><span class="annottext">[(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
</span><a href="#local-6989586621681122606"><span class="hs-identifier hs-var">pairs</span></a></span></span><span> </span><span id="local-6989586621681122605"><span class="annot"><span class="annottext">FailOperator GhcRn
</span><a href="#local-6989586621681122605"><span class="hs-identifier hs-var">mb_join</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122604"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122604"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122603"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122603"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-841"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122602"><span class="annot"><span class="annottext">tc_app_stmts :: ExpRhoType
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, thing)
</span><a href="#local-6989586621681122602"><span class="hs-identifier hs-var hs-var">tc_app_stmts</span></a></span></span><span> </span><span id="local-6989586621681122601"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122601"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
-&gt; ExpRhoType
-&gt; (Mult -&gt; TcM thing)
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, thing)
forall t.
HsStmtContext GhcRn
-&gt; [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
-&gt; ExpRhoType
-&gt; (Mult -&gt; TcM t)
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, t)
</span><a href="GHC.Tc.Gen.Match.html#tcApplicativeStmts"><span class="hs-identifier hs-var">tcApplicativeStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122607"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
</span><a href="#local-6989586621681122606"><span class="hs-identifier hs-var">pairs</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122601"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">((Mult -&gt; TcM thing)
 -&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, thing))
-&gt; (Mult -&gt; TcM thing)
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-842"></span><span>                                </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122603"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">(ExpRhoType -&gt; TcM thing)
-&gt; (Mult -&gt; ExpRhoType) -&gt; Mult -&gt; TcM thing
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span>
</span><span id="line-843"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122599"><span class="annot"><span class="annottext">[(SyntaxExprTc, ApplicativeArg GhcTc)]
</span><a href="#local-6989586621681122599"><span class="hs-identifier hs-var">pairs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122598"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122598"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122597"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122597"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122596"><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="#local-6989586621681122596"><span class="hs-identifier hs-var">mb_join'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FailOperator GhcRn
</span><a href="#local-6989586621681122605"><span class="hs-identifier hs-var">mb_join</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-844"></span><span>            </span><span class="annot"><span class="annottext">FailOperator GhcRn
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
 -&gt; (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
     Maybe SyntaxExprTc))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
      Maybe SyntaxExprTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, thing)
</span><a href="#local-6989586621681122602"><span class="hs-identifier hs-var">tc_app_stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122604"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-845"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681122594"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122594"><span class="hs-identifier hs-var">join_op</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-846"></span><span>              </span><span class="annot"><span class="annottext">(SyntaxExprTc -&gt; Maybe SyntaxExprTc)
-&gt; (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
    SyntaxExprTc)
-&gt; (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
    Maybe SyntaxExprTc)
forall (a :: * -&gt; * -&gt; *) b c d.
Arrow a =&gt;
a b c -&gt; a (d, b) (d, c)
</span><a href="../../base/src/Control.Arrow.html#second"><span class="hs-identifier hs-var">second</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc -&gt; Maybe SyntaxExprTc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">((([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
  SyntaxExprTc)
 -&gt; (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
     Maybe SyntaxExprTc))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
      SyntaxExprTc)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
      Maybe SyntaxExprTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-847"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult]
    -&gt; [Mult]
    -&gt; IOEnv
         (Env TcGblEnv TcLclEnv)
         ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
      SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122594"><span class="hs-identifier hs-var">join_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122604"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult]
  -&gt; [Mult]
  -&gt; IOEnv
       (Env TcGblEnv TcLclEnv)
       ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing))
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
       SyntaxExprTc))
-&gt; ([Mult]
    -&gt; [Mult]
    -&gt; IOEnv
         (Env TcGblEnv TcLclEnv)
         ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing),
      SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-848"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122593"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122593"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122592"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122592"><span class="hs-identifier hs-var">rhs_mult</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122592"><span class="hs-identifier hs-var">rhs_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv
   (Env TcGblEnv TcLclEnv)
   ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, thing)
</span><a href="#local-6989586621681122602"><span class="hs-identifier hs-var">tc_app_stmts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122593"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-849"></span><span>
</span><span id="line-850"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XApplicativeStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; [(SyntaxExpr GhcTc, ApplicativeArg GhcTc)]
-&gt; FailOperator GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XApplicativeStmt idL idR body
-&gt; [(SyntaxExpr idR, ApplicativeArg idL)]
-&gt; Maybe (SyntaxExpr idR)
-&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#ApplicativeStmt"><span class="hs-identifier hs-var">ApplicativeStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XApplicativeStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681122598"><span class="hs-identifier hs-var">body_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[(SyntaxExpr GhcTc, ApplicativeArg GhcTc)]
[(SyntaxExprTc, ApplicativeArg GhcTc)]
</span><a href="#local-6989586621681122599"><span class="hs-identifier hs-var">pairs'</span></a></span><span> </span><span class="annot"><span class="annottext">FailOperator GhcTc
Maybe SyntaxExprTc
</span><a href="#local-6989586621681122596"><span class="hs-identifier hs-var">mb_join'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122597"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-851"></span><span>
</span><span id="line-852"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcRn GhcRn (LHsExpr GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122591"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122591"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681122590"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122590"><span class="hs-identifier hs-var">then_op</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681122589"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122589"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122588"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122588"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-853"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span>       </span><span class="hs-comment">-- Deal with rebindable syntax;</span><span>
</span><span id="line-854"></span><span>                </span><span class="hs-comment">--   (&gt;&gt;) :: rhs_ty -&gt; new_res_ty -&gt; res_ty</span><span>
</span><span id="line-855"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122587"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122587"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122586"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122586"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122585"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122585"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122584"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122584"><span class="hs-identifier hs-var">then_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-856"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc, Mult, thing))
-&gt; TcM ((LHsExpr GhcTc, Mult, thing), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122590"><span class="hs-identifier hs-var">then_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122589"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc, Mult, thing))
 -&gt; TcM ((LHsExpr GhcTc, Mult, thing), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (LHsExpr GhcTc, Mult, thing))
-&gt; TcM ((LHsExpr GhcTc, Mult, thing), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-857"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122583"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122583"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122582"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122582"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122581"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122581"><span class="hs-identifier hs-var">rhs_mult</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681122580"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122580"><span class="hs-identifier hs-var">fun_mult</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-858"></span><span>               </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122579"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122579"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122581"><span class="hs-identifier hs-var">rhs_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExprNC"><span class="hs-identifier hs-var">tcCheckMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122591"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122583"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span>
</span><span id="line-859"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122578"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122578"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM thing -&gt; TcM thing
forall a. Mult -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#tcScalingUsage"><span class="hs-identifier hs-var">tcScalingUsage</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122580"><span class="hs-identifier hs-var">fun_mult</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM thing) -&gt; TcM thing -&gt; TcM thing
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122588"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122582"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-860"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc, Mult, thing) -&gt; TcM (LHsExpr GhcTc, Mult, thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122579"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122583"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122578"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-861"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
-&gt; LHsExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsExpr GhcTc)
forall idL idR body.
XBodyStmt idL idR body
-&gt; body -&gt; SyntaxExpr idR -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-var">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
XBodyStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681122586"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122587"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122584"><span class="hs-identifier hs-var">then_op'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122585"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-862"></span><span>
</span><span id="line-863"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span id="local-6989586621681122577"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122577"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [LStmtLR idL idR body]
</span><a href="GHC.Hs.Expr.html#recS_stmts"><span class="hs-identifier hs-var">recS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122574"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122574"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_later_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_later_ids"><span class="hs-identifier hs-var">recS_later_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122572"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681122572"><span class="hs-identifier hs-var">later_names</span></a></span></span><span>
</span><span id="line-864"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_rec_ids"><span class="hs-identifier hs-var">recS_rec_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122570"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681122570"><span class="hs-identifier hs-var">rec_names</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ret_fn :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#recS_ret_fn"><span class="hs-identifier hs-var">recS_ret_fn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122568"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122568"><span class="hs-identifier hs-var">ret_op</span></a></span></span><span>
</span><span id="line-865"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_mfix_fn :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#recS_mfix_fn"><span class="hs-identifier hs-var">recS_mfix_fn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122566"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122566"><span class="hs-identifier hs-var">mfix_op</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_bind_fn :: forall idL idR body. StmtLR idL idR body -&gt; SyntaxExpr idR
</span><a href="GHC.Hs.Expr.html#recS_bind_fn"><span class="hs-identifier hs-var">recS_bind_fn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122564"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122564"><span class="hs-identifier hs-var">bind_op</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-866"></span><span>         </span><span id="local-6989586621681122563"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122563"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681122562"><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122562"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-867"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122561"><span class="annot"><span class="annottext">tup_names :: [Name]
</span><a href="#local-6989586621681122561"><span class="hs-identifier hs-var hs-var">tup_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122570"><span class="hs-identifier hs-var">rec_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [Name] -&gt; [Name]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122570"><span class="hs-identifier hs-var">rec_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122572"><span class="hs-identifier hs-var">later_names</span></a></span><span>
</span><span id="line-868"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122558"><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122558"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult]
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTys"><span class="hs-identifier hs-var">newFlexiTyVarTys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Arity
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Arity
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122561"><span class="hs-identifier hs-var">tup_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-869"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122555"><span class="annot"><span class="annottext">tup_ids :: [Id]
</span><a href="#local-6989586621681122555"><span class="hs-identifier hs-var hs-var">tup_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Mult -&gt; Id) -&gt; [Name] -&gt; [Mult] -&gt; [Id]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681122554"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122554"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681122553"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122553"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Mult -&gt; Mult -&gt; Id
Name -&gt; Mult -&gt; Mult -&gt; Id
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122554"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122553"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122561"><span class="hs-identifier hs-var">tup_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122558"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span><span>
</span><span id="line-870"></span><span>                </span><span class="hs-comment">-- Many because it's a recursive definition</span><span>
</span><span id="line-871"></span><span>              </span><span id="local-6989586621681122552"><span class="annot"><span class="annottext">tup_ty :: Mult
</span><a href="#local-6989586621681122552"><span class="hs-identifier hs-var hs-var">tup_ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; Mult
</span><a href="GHC.Core.Make.html#mkBigCoreTupTy"><span class="hs-identifier hs-var">mkBigCoreTupTy</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122558"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span><span>
</span><span id="line-872"></span><span>
</span><span id="line-873"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Id]
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall a. [Id] -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Env.html#tcExtendIdEnv"><span class="hs-identifier hs-var">tcExtendIdEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122555"><span class="hs-identifier hs-var">tup_ids</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
 -&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing))
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-874"></span><span>        </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122551"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122551"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122550"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122550"><span class="hs-identifier hs-var">ret_op'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122549"><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681122549"><span class="hs-identifier hs-var">tup_rets</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122548"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122548"><span class="hs-identifier hs-var">stmts_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-875"></span><span>                </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ExpRhoType
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])))
-&gt; TcM
     (([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])),
      Mult)
forall a. (ExpRhoType -&gt; TcM a) -&gt; TcM (a, Mult)
</span><a href="GHC.Tc.Utils.TcMType.html#tcInfer"><span class="hs-identifier hs-var">tcInfer</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType
  -&gt; TcM
       ([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])))
 -&gt; TcM
      (([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])),
       Mult))
-&gt; (ExpRhoType
    -&gt; TcM
         ([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])))
-&gt; TcM
     (([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])),
      Mult)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681122546"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122546"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-876"></span><span>                   </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM (SyntaxExprTc, [HsExpr GhcTc]))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc]))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122577"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122574"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122546"><span class="hs-identifier hs-var">exp_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM (SyntaxExprTc, [HsExpr GhcTc]))
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc])))
-&gt; (ExpRhoType -&gt; TcM (SyntaxExprTc, [HsExpr GhcTc]))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)], (SyntaxExprTc, [HsExpr GhcTc]))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681122545"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122545"><span class="hs-identifier hs-var">inner_res_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-877"></span><span>                   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122544"><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681122544"><span class="hs-identifier hs-var">tup_rets</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; ExpRhoType -&gt; TcM (HsExpr GhcTc))
-&gt; [Name]
-&gt; [ExpRhoType]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [HsExpr GhcTc]
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m [c]
</span><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier hs-var">zipWithM</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; ExpRhoType -&gt; TcM (HsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckId"><span class="hs-identifier hs-var">tcCheckId</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681122561"><span class="hs-identifier hs-var">tup_names</span></a></span><span>
</span><span id="line-878"></span><span>                                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Mult -&gt; ExpRhoType) -&gt; [Mult] -&gt; [ExpRhoType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122558"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-879"></span><span>                             </span><span class="hs-comment">-- Unify the types of the &quot;final&quot; Ids (which may</span><span>
</span><span id="line-880"></span><span>                             </span><span class="hs-comment">-- be polymorphic) with those of &quot;knot-tied&quot; Ids</span><span>
</span><span id="line-881"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122542"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122542"><span class="hs-identifier hs-var">ret_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-882"></span><span>                          </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122568"><span class="hs-identifier hs-var">ret_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122552"><span class="hs-identifier hs-var">tup_ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-883"></span><span>                                        </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122545"><span class="hs-identifier hs-var">inner_res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-884"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(SyntaxExprTc, [HsExpr GhcTc])
-&gt; TcM (SyntaxExprTc, [HsExpr GhcTc])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122542"><span class="hs-identifier hs-var">ret_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681122544"><span class="hs-identifier hs-var">tup_rets</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122541"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122541"><span class="hs-identifier hs-var">mfix_op'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122540"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122540"><span class="hs-identifier hs-var">mfix_res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-887"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ExpRhoType -&gt; TcM ((), SyntaxExprTc))
-&gt; TcM (((), SyntaxExprTc), Mult)
forall a. (ExpRhoType -&gt; TcM a) -&gt; TcM (a, Mult)
</span><a href="GHC.Tc.Utils.TcMType.html#tcInfer"><span class="hs-identifier hs-var">tcInfer</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM ((), SyntaxExprTc))
 -&gt; TcM (((), SyntaxExprTc), Mult))
-&gt; (ExpRhoType -&gt; TcM ((), SyntaxExprTc))
-&gt; TcM (((), SyntaxExprTc), Mult)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681122539"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122539"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-888"></span><span>               </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122566"><span class="hs-identifier hs-var">mfix_op</span></a></span><span>
</span><span id="line-889"></span><span>                          </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTyMany"><span class="hs-identifier hs-var">mkVisFunTyMany</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122552"><span class="hs-identifier hs-var">tup_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122548"><span class="hs-identifier hs-var">stmts_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122539"><span class="hs-identifier hs-var">exp_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-890"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122538"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122538"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122537"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122537"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122536"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122536"><span class="hs-identifier hs-var">bind_op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-893"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (thing, Mult))
-&gt; TcM ((thing, Mult), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122564"><span class="hs-identifier hs-var">bind_op</span></a></span><span>
</span><span id="line-894"></span><span>                          </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122540"><span class="hs-identifier hs-var">mfix_res_ty</span></a></span><span>
</span><span id="line-895"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType -&gt; SyntaxOpType -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynFun"><span class="hs-identifier hs-var">SynFun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122552"><span class="hs-identifier hs-var">tup_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#SynRho"><span class="hs-identifier hs-var">SynRho</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-896"></span><span>                          </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122563"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcM (thing, Mult))
 -&gt; TcM ((thing, Mult), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM (thing, Mult))
-&gt; TcM ((thing, Mult), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-897"></span><span>               </span><span class="hs-glyph">\</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681122535"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122535"><span class="hs-identifier hs-var">new_res_ty</span></a></span></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-898"></span><span>               </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122534"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122534"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><a href="#local-6989586621681122562"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122535"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-899"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(thing, Mult) -&gt; TcM (thing, Mult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122534"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122535"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-900"></span><span>
</span><span id="line-901"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122533"><span class="annot"><span class="annottext">rec_ids :: [Id]
</span><a href="#local-6989586621681122533"><span class="hs-identifier hs-var hs-var">rec_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [Id] -&gt; [Id]
forall b a. [b] -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#takeList"><span class="hs-identifier hs-var">takeList</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122570"><span class="hs-identifier hs-var">rec_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122555"><span class="hs-identifier hs-var">tup_ids</span></a></span><span>
</span><span id="line-902"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122531"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122531"><span class="hs-identifier hs-var">later_ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; TcM [Id]
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocalIds"><span class="hs-identifier hs-var">tcLookupLocalIds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681122572"><span class="hs-identifier hs-var">later_names</span></a></span><span>
</span><span id="line-903"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceTc"><span class="hs-identifier hs-var">traceTc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcdo&quot;</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; TcRn ()) -&gt; SDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122533"><span class="hs-identifier hs-var">rec_ids</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Mult) -&gt; [Id] -&gt; [Mult]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Mult
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122533"><span class="hs-identifier hs-var">rec_ids</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-904"></span><span>                                 </span><span class="annot"><span class="annottext">[Id] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122531"><span class="hs-identifier hs-var">later_ids</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Id -&gt; Mult) -&gt; [Id] -&gt; [Mult]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Mult
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681122531"><span class="hs-identifier hs-var">later_ids</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-905"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsExpr GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecStmt :: forall idL idR body.
XRecStmt idL idR body
-&gt; [LStmtLR idL idR body]
-&gt; [IdP idR]
-&gt; [IdP idR]
-&gt; SyntaxExpr idR
-&gt; SyntaxExpr idR
-&gt; SyntaxExpr idR
-&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_stmts :: [LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="GHC.Hs.Expr.html#recS_stmts"><span class="hs-identifier hs-var">recS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122551"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_later_ids :: [IdP GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_later_ids"><span class="hs-identifier hs-var">recS_later_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681122531"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-906"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_ids :: [IdP GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_rec_ids"><span class="hs-identifier hs-var">recS_rec_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id]
[IdP GhcTc]
</span><a href="#local-6989586621681122533"><span class="hs-identifier hs-var">rec_ids</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ret_fn :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#recS_ret_fn"><span class="hs-identifier hs-var">recS_ret_fn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122550"><span class="hs-identifier hs-var">ret_op'</span></a></span><span>
</span><span id="line-907"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_mfix_fn :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#recS_mfix_fn"><span class="hs-identifier hs-var">recS_mfix_fn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122541"><span class="hs-identifier hs-var">mfix_op'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_bind_fn :: SyntaxExpr GhcTc
</span><a href="GHC.Hs.Expr.html#recS_bind_fn"><span class="hs-identifier hs-var">recS_bind_fn</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681122536"><span class="hs-identifier hs-var">bind_op'</span></a></span><span>
</span><span id="line-908"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ext :: XRecStmt GhcTc GhcTc (LHsExpr GhcTc)
</span><a href="GHC.Hs.Expr.html#recS_ext"><span class="hs-identifier hs-var">recS_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RecStmtTc :: Mult -&gt; [HsExpr GhcTc] -&gt; [HsExpr GhcTc] -&gt; Mult -&gt; RecStmtTc
</span><a href="GHC.Hs.Expr.html#RecStmtTc"><span class="hs-identifier hs-type">RecStmtTc</span></a></span><span>
</span><span id="line-909"></span><span>                            </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_bind_ty :: Mult
</span><a href="GHC.Hs.Expr.html#recS_bind_ty"><span class="hs-identifier hs-var">recS_bind_ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122537"><span class="hs-identifier hs-var">new_res_ty</span></a></span><span>
</span><span id="line-910"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_later_rets :: [HsExpr GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_later_rets"><span class="hs-identifier hs-var">recS_later_rets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-911"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_rets :: [HsExpr GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_rec_rets"><span class="hs-identifier hs-var">recS_rec_rets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681122549"><span class="hs-identifier hs-var">tup_rets</span></a></span><span>
</span><span id="line-912"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ret_ty :: Mult
</span><a href="GHC.Hs.Expr.html#recS_ret_ty"><span class="hs-identifier hs-var">recS_ret_ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122548"><span class="hs-identifier hs-var">stmts_ty</span></a></span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681122538"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-913"></span><span>        </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-914"></span><span>
</span><span id="line-915"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681122523"><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122523"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM thing
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-916"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcM (Stmt GhcTc (LHsExpr GhcTc), thing)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcDoStmt: unexpected Stmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn) -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Stmt GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681122523"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-917"></span><span>
</span><span id="line-918"></span><span>
</span><span id="line-919"></span><span>
</span><span id="line-920"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-921"></span><span class="hs-comment">-- MonadFail Proposal warnings</span><span>
</span><span id="line-922"></span><span class="hs-comment">---------------------------------------------------</span><span>
</span><span id="line-923"></span><span>
</span><span id="line-924"></span><span class="hs-comment">-- The idea behind issuing MonadFail warnings is that we add them whenever a</span><span>
</span><span id="line-925"></span><span class="hs-comment">-- failable pattern is encountered. However, instead of throwing a type error</span><span>
</span><span id="line-926"></span><span class="hs-comment">-- when the constraint cannot be satisfied, we only issue a warning in</span><span>
</span><span id="line-927"></span><span class="hs-comment">-- &quot;GHC.Tc.Errors&quot;.</span><span>
</span><span id="line-928"></span><span>
</span><span id="line-929"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcMonadFailOp"><span class="hs-identifier hs-type">tcMonadFailOp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html#CtOrigin"><span class="hs-identifier hs-type">CtOrigin</span></a></span><span>
</span><span id="line-930"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-931"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>    </span><span class="hs-comment">-- The fail op</span><span>
</span><span id="line-932"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>              </span><span class="hs-comment">-- Type of the whole do-expression</span><span>
</span><span id="line-933"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRn"><span class="hs-identifier hs-type">TcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#FailOperator"><span class="hs-identifier hs-type">FailOperator</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Typechecked fail op</span><span>
</span><span id="line-934"></span><span class="hs-comment">-- Get a 'fail' operator expression, to use if the pattern match fails.</span><span>
</span><span id="line-935"></span><span class="hs-comment">-- This won't be used in cases where we've already determined the pattern</span><span>
</span><span id="line-936"></span><span class="hs-comment">-- match can't fail (so the fail op is Nothing), however, it seems that the</span><span>
</span><span id="line-937"></span><span class="hs-comment">-- isIrrefutableHsPat test is still required here for some reason I haven't</span><span>
</span><span id="line-938"></span><span class="hs-comment">-- yet determined.</span><span>
</span><span id="line-939"></span><span id="tcMonadFailOp"><span class="annot"><span class="annottext">tcMonadFailOp :: CtOrigin
-&gt; LPat GhcTc
-&gt; SyntaxExpr GhcRn
-&gt; Mult
-&gt; TcRn (FailOperator GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcMonadFailOp"><span class="hs-identifier hs-var hs-var">tcMonadFailOp</span></a></span></span><span> </span><span id="local-6989586621681122521"><span class="annot"><span class="annottext">CtOrigin
</span><a href="#local-6989586621681122521"><span class="hs-identifier hs-var">orig</span></a></span></span><span> </span><span id="local-6989586621681122520"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681122520"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681122519"><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><a href="#local-6989586621681122519"><span class="hs-identifier hs-var">fail_op</span></a></span></span><span> </span><span id="local-6989586621681122518"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122518"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-940"></span><span>    </span><span id="local-6989586621681122517"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681122517"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-941"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; LPat GhcTc -&gt; Bool
forall (p :: Pass).
OutputableBndrId p =&gt;
DynFlags -&gt; LPat (GhcPass p) -&gt; Bool
</span><a href="GHC.Hs.Pat.html#isIrrefutableHsPat"><span class="hs-identifier hs-var">isIrrefutableHsPat</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681122517"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681122520"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-942"></span><span>      </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-943"></span><span>      </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc -&gt; Maybe SyntaxExprTc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(SyntaxExprTc -&gt; Maybe SyntaxExprTc)
-&gt; (((), SyntaxExprTc) -&gt; SyntaxExprTc)
-&gt; ((), SyntaxExprTc)
-&gt; Maybe SyntaxExprTc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">((), SyntaxExprTc) -&gt; SyntaxExprTc
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(((), SyntaxExprTc) -&gt; Maybe SyntaxExprTc)
-&gt; TcM ((), SyntaxExprTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="#local-6989586621681122521"><span class="hs-identifier hs-var">orig</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122519"><span class="hs-identifier hs-var">fail_op</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#stringTy"><span class="hs-identifier hs-var">stringTy</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-944"></span><span>                            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122518"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-945"></span><span>
</span><span id="line-946"></span><span class="hs-comment">{-
Note [Treat rebindable syntax first]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When typechecking
        do { bar; ... } :: IO ()
we want to typecheck 'bar' in the knowledge that it should be an IO thing,
pushing info from the context into the RHS.  To do this, we check the
rebindable syntax first, and push that information into (tcLExprNC rhs).
Otherwise the error shows up when checking the rebindable syntax, and
the expected/inferred stuff is back to front (see #3613).

Note [typechecking ApplicativeStmt]

join ((\pat1 ... patn -&gt; body) &lt;$&gt; e1 &lt;*&gt; ... &lt;*&gt; en)

fresh type variables:
   pat_ty_1..pat_ty_n
   exp_ty_1..exp_ty_n
   t_1..t_(n-1)

body  :: body_ty
(\pat1 ... patn -&gt; body) :: pat_ty_1 -&gt; ... -&gt; pat_ty_n -&gt; body_ty
pat_i :: pat_ty_i
e_i   :: exp_ty_i
&lt;$&gt;   :: (pat_ty_1 -&gt; ... -&gt; pat_ty_n -&gt; body_ty) -&gt; exp_ty_1 -&gt; t_1
&lt;*&gt;_i :: t_(i-1) -&gt; exp_ty_i -&gt; t_i
join :: tn -&gt; res_ty
-}</span><span>
</span><span id="line-974"></span><span>
</span><span id="line-975"></span><span id="local-6989586621681123604"><span class="annot"><a href="GHC.Tc.Gen.Match.html#tcApplicativeStmts"><span class="hs-identifier hs-type">tcApplicativeStmts</span></a></span><span>
</span><span id="line-976"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsStmtContext"><span class="hs-identifier hs-type">HsStmtContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-977"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArg"><span class="hs-identifier hs-type">ApplicativeArg</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-978"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>                         </span><span class="hs-comment">-- rhs_ty</span><span>
</span><span id="line-979"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcRhoType"><span class="hs-identifier hs-type">TcRhoType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123604"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span><span>               </span><span class="hs-comment">-- thing_inside</span><span>
</span><span id="line-980"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExpr"><span class="hs-identifier hs-type">SyntaxExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArg"><span class="hs-identifier hs-type">ApplicativeArg</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681123604"><span class="hs-identifier hs-type">t</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-981"></span><span>
</span><span id="line-982"></span><span id="tcApplicativeStmts"><span class="annot"><span class="annottext">tcApplicativeStmts :: forall t.
HsStmtContext GhcRn
-&gt; [(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
-&gt; ExpRhoType
-&gt; (Mult -&gt; TcM t)
-&gt; TcM ([(SyntaxExpr GhcTc, ApplicativeArg GhcTc)], Mult, t)
</span><a href="GHC.Tc.Gen.Match.html#tcApplicativeStmts"><span class="hs-identifier hs-var hs-var">tcApplicativeStmts</span></a></span></span><span> </span><span id="local-6989586621681122474"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122474"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681122473"><span class="annot"><span class="annottext">[(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
</span><a href="#local-6989586621681122473"><span class="hs-identifier hs-var">pairs</span></a></span></span><span> </span><span id="local-6989586621681122472"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122472"><span class="hs-identifier hs-var">rhs_ty</span></a></span></span><span> </span><span id="local-6989586621681122471"><span class="annot"><span class="annottext">Mult -&gt; TcM t
</span><a href="#local-6989586621681122471"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-983"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122470"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122470"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-984"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122469"><span class="annot"><span class="annottext">arity :: Arity
</span><a href="#local-6989586621681122469"><span class="hs-identifier hs-var hs-var">arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(SyntaxExprRn, ApplicativeArg GhcRn)] -&gt; Arity
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Arity
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
[(SyntaxExprRn, ApplicativeArg GhcRn)]
</span><a href="#local-6989586621681122473"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-985"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122468"><span class="annot"><span class="annottext">[ExpRhoType]
</span><a href="#local-6989586621681122468"><span class="hs-identifier hs-var">ts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ExpRhoType
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [ExpRhoType]
forall (m :: * -&gt; *) a. Applicative m =&gt; Arity -&gt; m a -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier hs-var">replicateM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681122469"><span class="hs-identifier hs-var">arity</span></a></span><span class="annot"><span class="annottext">Arity -&gt; Arity -&gt; Arity
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ExpRhoType
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [ExpRhoType])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ExpRhoType
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [ExpRhoType]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) ExpRhoType
</span><a href="GHC.Tc.Utils.TcMType.html#newInferExpType"><span class="hs-identifier hs-var">newInferExpType</span></a></span><span>
</span><span id="line-986"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122465"><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122465"><span class="hs-identifier hs-var">exp_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; TcM Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult]
forall (m :: * -&gt; *) a. Applicative m =&gt; Arity -&gt; m a -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier hs-var">replicateM</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681122469"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult])
-&gt; TcM Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-987"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122464"><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122464"><span class="hs-identifier hs-var">pat_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; TcM Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult]
forall (m :: * -&gt; *) a. Applicative m =&gt; Arity -&gt; m a -&gt; m [a]
</span><a href="../../base/src/Control.Monad.html#replicateM"><span class="hs-identifier hs-var">replicateM</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681122469"><span class="hs-identifier hs-var">arity</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult])
-&gt; TcM Mult -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Mult]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Mult -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-988"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681122463"><span class="annot"><span class="annottext">fun_ty :: Mult
</span><a href="#local-6989586621681122463"><span class="hs-identifier hs-var hs-var">fun_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Mult] -&gt; Mult -&gt; Mult
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122464"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122470"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-989"></span><span>
</span><span id="line-990"></span><span>       </span><span class="hs-comment">-- NB. do the &lt;$&gt;,&lt;*&gt; operators first, we don't want type errors here</span><span>
</span><span id="line-991"></span><span>       </span><span class="hs-comment">--     i.e. goOps before goArgs</span><span>
</span><span id="line-992"></span><span>       </span><span class="hs-comment">-- See Note [Treat rebindable syntax first]</span><span>
</span><span id="line-993"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122461"><span class="annot"><span class="annottext">[SyntaxExprRn]
</span><a href="#local-6989586621681122461"><span class="hs-identifier hs-var">ops</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122460"><span class="annot"><span class="annottext">[ApplicativeArg GhcRn]
</span><a href="#local-6989586621681122460"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(SyntaxExprRn, ApplicativeArg GhcRn)]
-&gt; ([SyntaxExprRn], [ApplicativeArg GhcRn])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(SyntaxExpr GhcRn, ApplicativeArg GhcRn)]
[(SyntaxExprRn, ApplicativeArg GhcRn)]
</span><a href="#local-6989586621681122473"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-994"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122459"><span class="annot"><span class="annottext">[SyntaxExprTc]
</span><a href="#local-6989586621681122459"><span class="hs-identifier hs-var">ops'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; [(SyntaxExprRn, ExpRhoType, Mult)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [SyntaxExprTc]
</span><a href="#local-6989586621681122458"><span class="hs-identifier hs-var">goOps</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122463"><span class="hs-identifier hs-var">fun_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SyntaxExprRn]
-&gt; [ExpRhoType] -&gt; [Mult] -&gt; [(SyntaxExprRn, ExpRhoType, Mult)]
forall a b c. [a] -&gt; [b] -&gt; [c] -&gt; [(a, b, c)]
</span><a href="../../base/src/GHC.List.html#zip3"><span class="hs-identifier hs-var">zip3</span></a></span><span> </span><span class="annot"><span class="annottext">[SyntaxExprRn]
</span><a href="#local-6989586621681122461"><span class="hs-identifier hs-var">ops</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ExpRhoType]
</span><a href="#local-6989586621681122468"><span class="hs-identifier hs-var">ts</span></a></span><span> </span><span class="annot"><span class="annottext">[ExpRhoType] -&gt; [ExpRhoType] -&gt; [ExpRhoType]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122472"><span class="hs-identifier hs-var">rhs_ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122465"><span class="hs-identifier hs-var">exp_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-995"></span><span>
</span><span id="line-996"></span><span>      </span><span class="hs-comment">-- Typecheck each ApplicativeArg separately</span><span>
</span><span id="line-997"></span><span>      </span><span class="hs-comment">-- See Note [ApplicativeDo and constraints]</span><span>
</span><span id="line-998"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122456"><span class="annot"><span class="annottext">[ApplicativeArg GhcTc]
</span><a href="#local-6989586621681122456"><span class="hs-identifier hs-var">args'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((ApplicativeArg GhcRn, Mult, Mult)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc))
-&gt; [(ApplicativeArg GhcRn, Mult, Mult)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [ApplicativeArg GhcTc]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult
-&gt; (ApplicativeArg GhcRn, Mult, Mult)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
</span><a href="#local-6989586621681122455"><span class="hs-identifier hs-var">goArg</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122470"><span class="hs-identifier hs-var">body_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ApplicativeArg GhcRn]
-&gt; [Mult] -&gt; [Mult] -&gt; [(ApplicativeArg GhcRn, Mult, Mult)]
forall a b c. [a] -&gt; [b] -&gt; [c] -&gt; [(a, b, c)]
</span><a href="../../base/src/GHC.List.html#zip3"><span class="hs-identifier hs-var">zip3</span></a></span><span> </span><span class="annot"><span class="annottext">[ApplicativeArg GhcRn]
</span><a href="#local-6989586621681122460"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122464"><span class="hs-identifier hs-var">pat_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><a href="#local-6989586621681122465"><span class="hs-identifier hs-var">exp_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-999"></span><span>
</span><span id="line-1000"></span><span>      </span><span class="hs-comment">-- Bring into scope all the things bound by the args,</span><span>
</span><span id="line-1001"></span><span>      </span><span class="hs-comment">-- and typecheck the thing_inside</span><span>
</span><span id="line-1002"></span><span>      </span><span class="hs-comment">-- See Note [ApplicativeDo and constraints]</span><span>
</span><span id="line-1003"></span><span>      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122454"><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681122454"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; TcM t -&gt; TcM t
forall a. [Id] -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Env.html#tcExtendIdEnv"><span class="hs-identifier hs-var">tcExtendIdEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ApplicativeArg GhcTc -&gt; [Id]) -&gt; [ApplicativeArg GhcTc] -&gt; [Id]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">ApplicativeArg GhcTc -&gt; [Id]
</span><a href="#local-6989586621681122452"><span class="hs-identifier hs-var">get_arg_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[ApplicativeArg GhcTc]
</span><a href="#local-6989586621681122456"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM t -&gt; TcM t) -&gt; TcM t -&gt; TcM t
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1004"></span><span>               </span><span class="annot"><span class="annottext">Mult -&gt; TcM t
</span><a href="#local-6989586621681122471"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122470"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-1005"></span><span>
</span><span id="line-1006"></span><span>      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, t)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     ([(SyntaxExprTc, ApplicativeArg GhcTc)], Mult, t)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SyntaxExprTc]
-&gt; [ApplicativeArg GhcTc] -&gt; [(SyntaxExprTc, ApplicativeArg GhcTc)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[SyntaxExprTc]
</span><a href="#local-6989586621681122459"><span class="hs-identifier hs-var">ops'</span></a></span><span> </span><span class="annot"><span class="annottext">[ApplicativeArg GhcTc]
</span><a href="#local-6989586621681122456"><span class="hs-identifier hs-var">args'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122470"><span class="hs-identifier hs-var">body_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">t
</span><a href="#local-6989586621681122454"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1007"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1008"></span><span>    </span><span id="local-6989586621681122458"><span class="annot"><span class="annottext">goOps :: Mult
-&gt; [(SyntaxExprRn, ExpRhoType, Mult)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [SyntaxExprTc]
</span><a href="#local-6989586621681122458"><span class="hs-identifier hs-var hs-var">goOps</span></a></span></span><span> </span><span class="annot"><span class="annottext">Mult
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SyntaxExprTc] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [SyntaxExprTc]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1009"></span><span>    </span><span class="annot"><a href="#local-6989586621681122458"><span class="hs-identifier hs-var">goOps</span></a></span><span> </span><span id="local-6989586621681122445"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122445"><span class="hs-identifier hs-var">t_left</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681122444"><span class="annot"><span class="annottext">SyntaxExprRn
</span><a href="#local-6989586621681122444"><span class="hs-identifier hs-var">op</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681122443"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122443"><span class="hs-identifier hs-var">t_i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681122442"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122442"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681122441"><span class="annot"><span class="annottext">[(SyntaxExprRn, ExpRhoType, Mult)]
</span><a href="#local-6989586621681122441"><span class="hs-identifier hs-var">ops</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1010"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122440"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122440"><span class="hs-identifier hs-var">op'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1011"></span><span>               </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ())
-&gt; TcM ((), SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([Mult] -&gt; [Mult] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoOrigin"><span class="hs-identifier hs-var">DoOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExprRn
</span><a href="#local-6989586621681122444"><span class="hs-identifier hs-var">op</span></a></span><span>
</span><span id="line-1012"></span><span>                             </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122445"><span class="hs-identifier hs-var">t_left</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Mult -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122442"><span class="hs-identifier hs-var">exp_ty</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122443"><span class="hs-identifier hs-var">t_i</span></a></span><span> </span><span class="annot"><span class="annottext">(([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc))
-&gt; ([Mult] -&gt; [Mult] -&gt; TcRn ()) -&gt; TcM ((), SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1013"></span><span>                   </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Mult]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1014"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122439"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122439"><span class="hs-identifier hs-var">t_i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM Mult
</span><a href="GHC.Tc.Utils.TcMType.html#readExpType"><span class="hs-identifier hs-var">readExpType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122443"><span class="hs-identifier hs-var">t_i</span></a></span><span>
</span><span id="line-1015"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122438"><span class="annot"><span class="annottext">[SyntaxExprTc]
</span><a href="#local-6989586621681122438"><span class="hs-identifier hs-var">ops'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Mult
-&gt; [(SyntaxExprRn, ExpRhoType, Mult)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [SyntaxExprTc]
</span><a href="#local-6989586621681122458"><span class="hs-identifier hs-var">goOps</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122439"><span class="hs-identifier hs-var">t_i</span></a></span><span> </span><span class="annot"><span class="annottext">[(SyntaxExprRn, ExpRhoType, Mult)]
</span><a href="#local-6989586621681122441"><span class="hs-identifier hs-var">ops</span></a></span><span>
</span><span id="line-1016"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[SyntaxExprTc] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [SyntaxExprTc]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681122440"><span class="hs-identifier hs-var">op'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExprTc -&gt; [SyntaxExprTc] -&gt; [SyntaxExprTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[SyntaxExprTc]
</span><a href="#local-6989586621681122438"><span class="hs-identifier hs-var">ops'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1017"></span><span>
</span><span id="line-1018"></span><span>    </span><span class="annot"><a href="#local-6989586621681122455"><span class="hs-identifier hs-type">goArg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArg"><span class="hs-identifier hs-type">ApplicativeArg</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1019"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArg"><span class="hs-identifier hs-type">ApplicativeArg</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1020"></span><span>
</span><span id="line-1021"></span><span>    </span><span id="local-6989586621681122455"><span class="annot"><span class="annottext">goArg :: Mult
-&gt; (ApplicativeArg GhcRn, Mult, Mult)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
</span><a href="#local-6989586621681122455"><span class="hs-identifier hs-var hs-var">goArg</span></a></span></span><span> </span><span id="local-6989586621681122437"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122437"><span class="hs-identifier hs-var">body_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArgOne"><span class="hs-identifier hs-type">ApplicativeArgOne</span></a></span><span>
</span><span id="line-1022"></span><span>                    </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">xarg_app_arg_one :: forall idL. ApplicativeArg idL -&gt; XApplicativeArgOne idL
</span><a href="GHC.Hs.Expr.html#xarg_app_arg_one"><span class="hs-identifier hs-var">xarg_app_arg_one</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122434"><span class="annot"><span class="annottext">XApplicativeArgOne GhcRn
</span><a href="#local-6989586621681122434"><span class="hs-identifier hs-var">fail_op</span></a></span></span><span>
</span><span id="line-1023"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">app_arg_pattern :: forall idL. ApplicativeArg idL -&gt; LPat idL
</span><a href="GHC.Hs.Expr.html#app_arg_pattern"><span class="hs-identifier hs-var">app_arg_pattern</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122432"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122432"><span class="hs-identifier hs-var">pat</span></a></span></span><span>
</span><span id="line-1024"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">arg_expr :: forall idL. ApplicativeArg idL -&gt; LHsExpr idL
</span><a href="GHC.Hs.Expr.html#arg_expr"><span class="hs-identifier hs-var">arg_expr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122430"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122430"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-1025"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122429"><span class="annot"><span class="annottext">Bool
is_body_stmt :: forall idL. ApplicativeArg idL -&gt; Bool
is_body_stmt :: Bool
</span><a href="GHC.Hs.Expr.html#is_body_stmt"><span class="hs-glyph hs-var hs-var">..</span></a></span></span><span>
</span><span id="line-1026"></span><span>                    </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122427"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122427"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122426"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122426"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1027"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; SrcSpan
</span><a href="GHC.Types.SrcLoc.html#combineSrcSpans"><span class="hs-identifier hs-var">combineSrcSpans</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcRn) -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681122432"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122430"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1028"></span><span>        </span><span class="annot"><span class="annottext">SDoc
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
forall a. SDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; Stmt GhcRn (LHsExpr GhcRn) -&gt; SDoc
forall (idL :: Pass) (idR :: Pass) body.
(OutputableBndrId idL, OutputableBndrId idR, Outputable body) =&gt;
HsStmtContext (GhcPass idL)
-&gt; StmtLR (GhcPass idL) (GhcPass idR) body -&gt; SDoc
</span><a href="GHC.Hs.Expr.html#pprStmtInCtxt"><span class="hs-identifier hs-var">pprStmtInCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122474"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcRn -&gt; LHsExpr GhcRn -&gt; Stmt GhcRn (LHsExpr GhcRn)
forall (bodyR :: * -&gt; *).
LPat GhcRn
-&gt; Located (bodyR GhcRn)
-&gt; StmtLR GhcRn GhcRn (Located (bodyR GhcRn))
</span><a href="GHC.Hs.Utils.html#mkRnBindStmt"><span class="hs-identifier hs-var">mkRnBindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122432"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122430"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1029"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122422"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122422"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; Mult -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExprNC"><span class="hs-identifier hs-var">tcCheckMonoExprNC</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681122430"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122426"><span class="hs-identifier hs-var">exp_ty</span></a></span><span>
</span><span id="line-1030"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122421"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122421"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcRn () -&gt; TcM (LPat GhcTc, ())
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122474"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122432"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Scaled Mult
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122427"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcM (LPat GhcTc, ()))
-&gt; TcRn () -&gt; TcM (LPat GhcTc, ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1031"></span><span>                          </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1032"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681122420"><span class="annot"><span class="annottext">Maybe SyntaxExprTc
</span><a href="#local-6989586621681122420"><span class="hs-identifier hs-var">fail_op'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Maybe (Maybe SyntaxExprTc) -&gt; Maybe SyntaxExprTc)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Maybe SyntaxExprTc) -&gt; Maybe SyntaxExprTc
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; ((SyntaxExprRn
     -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc)))
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprRn
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Maybe SyntaxExprTc))
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprRn
XApplicativeArgOne GhcRn
</span><a href="#local-6989586621681122434"><span class="hs-identifier hs-var">fail_op</span></a></span><span> </span><span class="annot"><span class="annottext">((SyntaxExprRn
  -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; (SyntaxExprRn
    -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681122419"><span class="annot"><span class="annottext">SyntaxExprRn
</span><a href="#local-6989586621681122419"><span class="hs-identifier hs-var">fail</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1033"></span><span>               </span><span class="annot"><span class="annottext">CtOrigin
-&gt; LPat GhcTc
-&gt; SyntaxExpr GhcRn
-&gt; Mult
-&gt; TcRn (FailOperator GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#tcMonadFailOp"><span class="hs-identifier hs-var">tcMonadFailOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcRn -&gt; CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#DoPatOrigin"><span class="hs-identifier hs-var">DoPatOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122432"><span class="hs-identifier hs-var">pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122421"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681122419"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122437"><span class="hs-identifier hs-var">body_ty</span></a></span><span>
</span><span id="line-1034"></span><span>
</span><span id="line-1035"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ApplicativeArg GhcTc
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ApplicativeArgOne :: forall idL.
XApplicativeArgOne idL
-&gt; LPat idL -&gt; LHsExpr idL -&gt; Bool -&gt; ApplicativeArg idL
</span><a href="GHC.Hs.Expr.html#ApplicativeArgOne"><span class="hs-identifier hs-type">ApplicativeArgOne</span></a></span><span>
</span><span id="line-1036"></span><span>                      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">xarg_app_arg_one :: XApplicativeArgOne GhcTc
</span><a href="GHC.Hs.Expr.html#xarg_app_arg_one"><span class="hs-identifier hs-var">xarg_app_arg_one</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe SyntaxExprTc
XApplicativeArgOne GhcTc
</span><a href="#local-6989586621681122420"><span class="hs-identifier hs-var">fail_op'</span></a></span><span>
</span><span id="line-1037"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">app_arg_pattern :: LPat GhcTc
</span><a href="GHC.Hs.Expr.html#app_arg_pattern"><span class="hs-identifier hs-var">app_arg_pattern</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122421"><span class="hs-identifier hs-var">pat'</span></a></span><span>
</span><span id="line-1038"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">arg_expr :: LHsExpr GhcTc
</span><a href="GHC.Hs.Expr.html#arg_expr"><span class="hs-identifier hs-var">arg_expr</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681122422"><span class="hs-identifier hs-var">rhs'</span></a></span><span>
</span><span id="line-1039"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
is_body_stmt :: Bool
is_body_stmt :: Bool
</span><a href="GHC.Hs.Expr.html#is_body_stmt"><span class="hs-glyph hs-var hs-var">..</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1040"></span><span>                    </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1041"></span><span>
</span><span id="line-1042"></span><span>    </span><span class="annot"><a href="#local-6989586621681122455"><span class="hs-identifier hs-var">goArg</span></a></span><span> </span><span id="local-6989586621681122418"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122418"><span class="hs-identifier hs-var">_body_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArgMany"><span class="hs-identifier hs-type">ApplicativeArgMany</span></a></span><span> </span><span id="local-6989586621681122416"><span class="annot"><span class="annottext">XApplicativeArgMany GhcRn
</span><a href="#local-6989586621681122416"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681122415"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122415"><span class="hs-identifier hs-var">stmts</span></a></span></span><span> </span><span id="local-6989586621681122414"><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681122414"><span class="hs-identifier hs-var">ret</span></a></span></span><span> </span><span id="local-6989586621681122413"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122413"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681122412"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122412"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122411"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122411"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681122410"><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122410"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1043"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122409"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122409"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122408"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122408"><span class="hs-identifier hs-var">ret'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681122407"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122407"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-1044"></span><span>                </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM (HsExpr GhcTc, Located (Pat GhcTc)))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      (HsExpr GhcTc, Located (Pat GhcTc)))
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122412"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcDoStmt"><span class="hs-identifier hs-var">tcDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681122415"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122410"><span class="hs-identifier hs-var">exp_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM (HsExpr GhcTc, Located (Pat GhcTc)))
 -&gt; TcM
      ([LStmt GhcTc (LHsExpr GhcTc)],
       (HsExpr GhcTc, Located (Pat GhcTc))))
-&gt; (ExpRhoType -&gt; TcM (HsExpr GhcTc, Located (Pat GhcTc)))
-&gt; TcM
     ([LStmt GhcTc (LHsExpr GhcTc)],
      (HsExpr GhcTc, Located (Pat GhcTc)))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1045"></span><span>                </span><span class="hs-glyph">\</span><span id="local-6989586621681122406"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122406"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1046"></span><span>                  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681122405"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122405"><span class="hs-identifier hs-var">ret'</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn -&gt; ExpRhoType -&gt; TcM (HsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcExpr"><span class="hs-identifier hs-var">tcExpr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcRn
</span><a href="#local-6989586621681122414"><span class="hs-identifier hs-var">ret</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681122406"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-1047"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122404"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122404"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcRn () -&gt; TcM (LPat GhcTc, ())
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled Mult -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122412"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681122413"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Mult -&gt; Scaled Mult
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">Mult
</span><a href="#local-6989586621681122411"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcM (LPat GhcTc, ()))
-&gt; TcRn () -&gt; TcM (LPat GhcTc, ())
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1048"></span><span>                                 </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1049"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsExpr GhcTc, Located (Pat GhcTc))
-&gt; TcM (HsExpr GhcTc, Located (Pat GhcTc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122405"><span class="hs-identifier hs-var">ret'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681122404"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1050"></span><span>                  </span><span class="hs-special">}</span><span>
</span><span id="line-1051"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ApplicativeArg GhcTc
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (ApplicativeArg GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XApplicativeArgMany GhcTc
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; HsExpr GhcTc
-&gt; LPat GhcTc
-&gt; HsStmtContext GhcRn
-&gt; ApplicativeArg GhcTc
forall idL.
XApplicativeArgMany idL
-&gt; [ExprLStmt idL]
-&gt; HsExpr idL
-&gt; LPat idL
-&gt; HsStmtContext GhcRn
-&gt; ApplicativeArg idL
</span><a href="GHC.Hs.Expr.html#ApplicativeArgMany"><span class="hs-identifier hs-var">ApplicativeArgMany</span></a></span><span> </span><span class="annot"><span class="annottext">XApplicativeArgMany GhcRn
XApplicativeArgMany GhcTc
</span><a href="#local-6989586621681122416"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681122409"><span class="hs-identifier hs-var">stmts'</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681122408"><span class="hs-identifier hs-var">ret'</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681122407"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681122412"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1052"></span><span>
</span><span id="line-1053"></span><span>    </span><span class="annot"><a href="#local-6989586621681122452"><span class="hs-identifier hs-type">get_arg_bndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArg"><span class="hs-identifier hs-type">ApplicativeArg</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1054"></span><span>    </span><span id="local-6989586621681122452"><span class="annot"><span class="annottext">get_arg_bndrs :: ApplicativeArg GhcTc -&gt; [Id]
</span><a href="#local-6989586621681122452"><span class="hs-identifier hs-var hs-var">get_arg_bndrs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArgOne"><span class="hs-identifier hs-type">ApplicativeArgOne</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">app_arg_pattern :: forall idL. ApplicativeArg idL -&gt; LPat idL
</span><a href="GHC.Hs.Expr.html#app_arg_pattern"><span class="hs-identifier hs-var">app_arg_pattern</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122403"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681122403"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; [IdP GhcTc]
forall p. CollectPass p =&gt; LPat p -&gt; [IdP p]
</span><a href="GHC.Hs.Utils.html#collectPatBinders"><span class="hs-identifier hs-var">collectPatBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681122403"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-1055"></span><span>    </span><span class="annot"><a href="#local-6989586621681122452"><span class="hs-identifier hs-var">get_arg_bndrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ApplicativeArgMany"><span class="hs-identifier hs-type">ApplicativeArgMany</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bv_pattern :: forall idL. ApplicativeArg idL -&gt; LPat idL
</span><a href="GHC.Hs.Expr.html#bv_pattern"><span class="hs-identifier hs-var">bv_pattern</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span id="local-6989586621681122400"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681122400"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; [IdP GhcTc]
forall p. CollectPass p =&gt; LPat p -&gt; [IdP p]
</span><a href="GHC.Hs.Utils.html#collectPatBinders"><span class="hs-identifier hs-var">collectPatBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681122400"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-1056"></span><span>
</span><span id="line-1057"></span><span class="hs-comment">{- Note [ApplicativeDo and constraints]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An applicative-do is supposed to take place in parallel, so
constraints bound in one arm can't possibly be available in another
(#13242).  Our current rule is this (more details and discussion
on the ticket). Consider

   ...stmts...
   ApplicativeStmts [arg1, arg2, ... argN]
   ...more stmts...

where argi :: ApplicativeArg. Each 'argi' itself contains one or more Stmts.
Now, we say that:

* Constraints required by the argi can be solved from
  constraint bound by ...stmts...

* Constraints and existentials bound by the argi are not available
  to solve constraints required either by argj (where i /= j),
  or by ...more stmts....

* Within the stmts of each 'argi' individually, however, constraints bound
  by earlier stmts can be used to solve later ones.

To achieve this, we just typecheck each 'argi' separately, bring all
the variables they bind into scope, and typecheck the thing_inside.

************************************************************************
*                                                                      *
\subsection{Errors and contexts}
*                                                                      *
************************************************************************

@sameNoOfArgs@ takes a @[RenamedMatch]@ and decides whether the same
number of args are used in each equation.
-}</span><span>
</span><span id="line-1093"></span><span>
</span><span id="line-1094"></span><span id="local-6989586621681123829"><span class="annot"><a href="GHC.Tc.Gen.Match.html#checkArgs"><span class="hs-identifier hs-type">checkArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123829"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-1095"></span><span id="checkArgs"><span class="annot"><span class="annottext">checkArgs :: forall body. Name -&gt; MatchGroup GhcRn body -&gt; TcRn ()
</span><a href="GHC.Tc.Gen.Match.html#checkArgs"><span class="hs-identifier hs-var hs-var">checkArgs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1096"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1097"></span><span class="annot"><a href="GHC.Tc.Gen.Match.html#checkArgs"><span class="hs-identifier hs-var">checkArgs</span></a></span><span> </span><span id="local-6989586621681122391"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122391"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681122390"><span class="annot"><span class="annottext">LMatch GhcRn body
</span><a href="#local-6989586621681122390"><span class="hs-identifier hs-var">match1</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681122389"><span class="annot"><span class="annottext">[LMatch GhcRn body]
</span><a href="#local-6989586621681122389"><span class="hs-identifier hs-var">matches</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1098"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn body] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn body]
</span><a href="#local-6989586621681122388"><span class="hs-identifier hs-var">bad_matches</span></a></span><span>
</span><span id="line-1099"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1100"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1101"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
forall a. SDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Equations for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681122391"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-1102"></span><span>                         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;have different numbers of arguments&quot;</span></span><span>
</span><span id="line-1103"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LMatch GhcRn body -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LMatch GhcRn body
</span><a href="#local-6989586621681122390"><span class="hs-identifier hs-var">match1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1104"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LMatch GhcRn body -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LMatch GhcRn body] -&gt; LMatch GhcRn body
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn body]
</span><a href="#local-6989586621681122388"><span class="hs-identifier hs-var">bad_matches</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1105"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1106"></span><span>    </span><span id="local-6989586621681122384"><span class="annot"><span class="annottext">n_args1 :: Arity
</span><a href="#local-6989586621681122384"><span class="hs-identifier hs-var hs-var">n_args1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LMatch GhcRn body -&gt; Arity
forall body. LMatch GhcRn body -&gt; Arity
</span><a href="#local-6989586621681122383"><span class="hs-identifier hs-var">args_in_match</span></a></span><span> </span><span class="annot"><span class="annottext">LMatch GhcRn body
</span><a href="#local-6989586621681122390"><span class="hs-identifier hs-var">match1</span></a></span><span>
</span><span id="line-1107"></span><span>    </span><span id="local-6989586621681122388"><span class="annot"><span class="annottext">bad_matches :: [LMatch GhcRn body]
</span><a href="#local-6989586621681122388"><span class="hs-identifier hs-var hs-var">bad_matches</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">LMatch GhcRn body
</span><a href="#local-6989586621681122382"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681122382"><span class="annot"><span class="annottext">LMatch GhcRn body
</span><a href="#local-6989586621681122382"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn body]
</span><a href="#local-6989586621681122389"><span class="hs-identifier hs-var">matches</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LMatch GhcRn body -&gt; Arity
forall body. LMatch GhcRn body -&gt; Arity
</span><a href="#local-6989586621681122383"><span class="hs-identifier hs-var">args_in_match</span></a></span><span> </span><span class="annot"><span class="annottext">LMatch GhcRn body
</span><a href="#local-6989586621681122382"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Arity -&gt; Arity -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681122384"><span class="hs-identifier hs-var">n_args1</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1108"></span><span>
</span><span id="line-1109"></span><span>    </span><span id="local-6989586621681123544"><span class="annot"><a href="#local-6989586621681122383"><span class="hs-identifier hs-type">args_in_match</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681123544"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span></span><span>
</span><span id="line-1110"></span><span>    </span><span id="local-6989586621681122383"><span class="annot"><span class="annottext">args_in_match :: forall body. LMatch GhcRn body -&gt; Arity
</span><a href="#local-6989586621681122383"><span class="hs-identifier hs-var hs-var">args_in_match</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681122379"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681122379"><span class="hs-identifier hs-var">pats</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcRn)] -&gt; Arity
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Arity
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681122379"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-1111"></span></pre></body></html>